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

add margin of handle width/height to tile content

parent 31df3767
......@@ -9,6 +9,9 @@ Control {
property int majorCount: 2
property var minorCounts: [5, 5]
property real handleWidth: 5
property real handleHeight: 5
property var _majorPositions: {
let positions = [];
for (let i = 0; i < majorCount; ++i) {
......@@ -29,10 +32,14 @@ Control {
property Component delegate
contentItem: Item {
id: contentArea
Item {
id: contentArea
anchors.fill: parent
anchors.leftMargin: -root.handleWidth / 2
anchors.rightMargin: -root.handleWidth / 2
anchors.topMargin: -root.handleHeight / 2
anchors.bottomMargin: -root.handleHeight / 2
Repeater {
id: contentRepeater
Item {
......@@ -74,19 +81,22 @@ Control {
visible: tileIndex >= 0 && majorIndex < root.majorCount && minorIndex < root.minorCounts[majorIndex]
Component.onCompleted: {
root.delegate.createObject(tile, {
root.delegate.createObject(tileContentArea, {
name: Qt.binding(() => tile.name),
index: Qt.binding(() => tile.index),
tileIndex: Qt.binding(() => tile.tileIndex),
});
}
// XXX
Rectangle {
id: tileContentArea
anchors.fill: parent
z: -1
anchors.leftMargin: root.handleWidth / 2
anchors.rightMargin: root.handleWidth / 2
anchors.topMargin: root.handleHeight / 2
anchors.bottomMargin: root.handleHeight / 2
border.width: 1
border.color: "gray"
border.color: "cyan" // XXX
color: "transparent"
}
}
......@@ -94,7 +104,7 @@ Control {
}
Item {
anchors.fill: parent
anchors.fill: contentArea
Repeater {
model: root.majorOrientation !== Qt.Horizontal ? root.majorCount : 0
......@@ -121,7 +131,9 @@ Control {
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 5
anchors.topMargin: root.handleHeight / 2
anchors.bottomMargin: root.handleHeight / 2
width: root.handleWidth
visible: index > 0
color: "gray"
......@@ -179,7 +191,9 @@ Control {
anchors.left: parent.left
anchors.right: parent.right
height: 5
anchors.leftMargin: root.handleWidth / 2
anchors.rightMargin: root.handleWidth / 2
height: root.handleHeight
visible: index > 0
color: "gray"
......@@ -221,7 +235,9 @@ Control {
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 5
anchors.topMargin: root.handleHeight / 2
anchors.bottomMargin: root.handleHeight / 2
width: root.handleWidth
visible: index > 0
color: "gray"
......@@ -261,7 +277,9 @@ Control {
anchors.left: parent.left
anchors.right: parent.right
height: 5
anchors.leftMargin: root.handleWidth / 2
anchors.rightMargin: root.handleWidth / 2
height: root.handleHeight
visible: index > 0
color: "gray"
......
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