Commit 2c2e4110 authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

add UI to configure tile count per row

parent f1bbe63e
......@@ -5,6 +5,11 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
Window {
id: root
property int leftCount: 5
property int rightCount: 5
width: 640
height: 480
visible: true
......@@ -32,21 +37,35 @@ Window {
required property int index
required property string name
readonly property int column: {
if (index < root.leftCount) {
return 0;
} else if (index < root.leftCount + root.rightCount) {
return 1;
} else {
return -1;
}
}
Pane {
id: leftPane
Package.name: "left"
visible: tile.index < 5
visible: tile.column === 0
}
Pane {
id: rightPane
Package.name: "right"
visible: tile.index >= 5
visible: tile.column === 1
}
Item {
id: stacked
Package.name: "stacked"
}
GridLayout {
parent: tile.index < 5 ? leftPane.contentItem : rightPane.contentItem
parent: [stacked, leftPane.contentItem, rightPane.contentItem][tile.column + 1]
anchors.fill: parent
columns: 2
Component.onCompleted: {
......@@ -100,5 +119,35 @@ Window {
}
}
}
Pane {
Layout.fillHeight: true
palette.window: "#f0f0f0"
GridLayout {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
columns: 2
Label { text: "leftCount:" }
SpinBox {
editable: true
value: root.leftCount
onValueModified: {
root.leftCount = value;
}
}
Label { text: "rightCount:" }
SpinBox {
editable: true
value: root.rightCount
onValueModified: {
root.rightCount = value;
}
}
}
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment