2020-06-05 19:42:12 +10:00
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Layouts 1.12
|
|
|
|
|
|
|
|
HGridLayout {
|
2020-07-12 12:06:37 +10:00
|
|
|
readonly property real summedImplicitWidth: {
|
|
|
|
let sum = 0
|
2020-06-05 19:42:12 +10:00
|
|
|
|
|
|
|
for (let i = 0; i < visibleChildren.length; i++) {
|
|
|
|
const item = visibleChildren[i]
|
2020-07-13 03:10:19 +10:00
|
|
|
|
|
|
|
if (item)
|
|
|
|
sum += (item.width > 0 ? item.implicitWidth : 0) +columnSpacing
|
2020-06-05 19:42:12 +10:00
|
|
|
}
|
|
|
|
|
2020-07-12 12:06:37 +10:00
|
|
|
return sum
|
2020-06-05 19:42:12 +10:00
|
|
|
}
|
|
|
|
|
2020-07-12 14:25:57 +10:00
|
|
|
|
2020-06-05 19:42:12 +10:00
|
|
|
flow:
|
|
|
|
width >= summedImplicitWidth ?
|
2020-07-12 12:06:37 +10:00
|
|
|
HGridLayout.LeftToRight :
|
|
|
|
HGridLayout.TopToBottom
|
2020-06-05 19:42:12 +10:00
|
|
|
}
|