Commit 9038f6b1 authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

reimplement tile count UI

parent 3e977b38
......@@ -93,33 +93,43 @@ Window {
Label { text: "majorCount:" }
SpinBox {
enabled: false
editable: true
value: tileListModel.majorCount
onValueModified: {
// TODO
let counts = tileListModel.minorCounts.slice(0, value);
let n = counts.length > 0 ? counts[counts.length - 1] : 0;
for (let i = counts.length; i < value; ++i) {
counts.push(n);
}
tileListModel.resetLayout(tileListModel.majorOrientation, counts);
}
}
Label { text: "minorCount[0]:" }
SpinBox {
editable: true
value: tileListModel.minorCounts[0]
onValueModified: {
let counts = tileListModel.minorCounts.slice();
counts[0] = value;
tileListModel.resetLayout(tileListModel.majorOrientation, counts);
Repeater {
model: tileMinorCountsRepeater.count
Label {
required property int index
Layout.column: 0
Layout.row: 2 + index
text: "minorCount[%1]:".arg(index)
}
}
Label { text: "minorCount[1]:" }
SpinBox {
editable: true
value: tileListModel.minorCounts[1]
onValueModified: {
let counts = tileListModel.minorCounts.slice();
counts[1] = value;
tileListModel.resetLayout(tileListModel.majorOrientation, counts);
Repeater {
id: tileMinorCountsRepeater
model: tileListModel.minorCounts.slice()
SpinBox {
required property int index
required property int modelData
Layout.column: 1
Layout.row: 2 + index
editable: true
value: modelData
onValueModified: {
let counts = tileListModel.minorCounts.slice();
counts[index] = value;
tileListModel.resetLayout(tileListModel.majorOrientation, counts);
}
}
}
......
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