Merge pull request 'Responsive Container grid' (#16) from 03-responsivePane into master

Reviewed-on: #16
This commit is contained in:
erinn 2020-09-18 16:06:00 -07:00
commit 12b7e51497
1 changed files with 27 additions and 0 deletions

27
ResponsiveContainer.qml Normal file
View File

@ -0,0 +1,27 @@
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
GridLayout {
id: root
// have children ... control weather to stack or row them
// n * minWidth determin
property int minCellWidth: 500
onWidthChanged: resizeCheck()
function resizeCheck() {
if (width < children.length * minCellWidth) {
root.rows = -1
root.columns = 1
} else {
root.rows = 1
root.columns = -1
}
}
}