opaque/ResponsiveContainer.qml

29 lines
610 B
QML
Raw Normal View History

2020-09-17 22:54:06 +00:00
import QtQuick 2.7
import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.0
import QtQuick.Layouts 1.3
import QtQuick.Controls 1.4
2020-12-02 01:13:07 +00:00
import "theme"
2020-09-17 22:54:06 +00:00
GridLayout {
id: root
2020-12-17 16:10:21 +00:00
// have children ... control whether to stack or row them
// n * minWidth determines row or column
property int minCellWidth: Theme.sidePaneMinSize
2020-09-17 22:54:06 +00:00
onWidthChanged: resizeCheck()
function resizeCheck() {
if (width < children.length * minCellWidth) {
root.rows = -1
root.columns = 1
} else {
root.rows = 1
root.columns = -1
}
}
}