moment/src/gui/Base/AutoDirectionLayout.qml

19 lines
500 B
QML
Raw Normal View History

// Copyright Mirage authors & contributors <https://github.com/mirukana/mirage>
// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.12
import QtQuick.Layouts 1.12
HGridLayout {
readonly property real summedImplicitWidth:
utils.sumChildrenImplicitWidths(visibleChildren, columnSpacing)
2020-07-22 07:34:45 +10:00
readonly property bool vertical: flow === HGridLayout.TopToBottom
flow:
width >= summedImplicitWidth ?
HGridLayout.LeftToRight :
HGridLayout.TopToBottom
}