diff options
Diffstat (limited to 'multilayer-dashboard/Button.qml')
-rw-r--r-- | multilayer-dashboard/Button.qml | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/multilayer-dashboard/Button.qml b/multilayer-dashboard/Button.qml index 757e213..16927d4 100644 --- a/multilayer-dashboard/Button.qml +++ b/multilayer-dashboard/Button.qml @@ -7,7 +7,6 @@ Rectangle { property string text : "Press me, Hold me, Strike me" property int counter : 0 property string bgColor: "steelblue" - property bool marked : false property bool enabled : state != "disabled" @@ -26,25 +25,22 @@ Rectangle { Rectangle { id: mark + anchors.verticalCenter: button.verticalCenter x: 10 - y: 5 - width: 0 - height: 0 - radius: 30 + width: button.height/2 + height: button.height/2 + radius: button.height/2 color: "black" opacity: 1.0 smooth: true + visible: false } function toggleMark() { - button.marked = !button.marked - if (button.marked) { - mark.width = 30 - mark.height = 30 - } else { - mark.width = 0 - mark.height = 0 - } + if (mark.visible == false) + mark.visible = true + else + mark.visible = false } function increaseCounter() { @@ -55,6 +51,7 @@ Rectangle { id: labelText text: parent.text + (counter ? " "+counter : "") anchors.centerIn: parent + font.pointSize: 15 } Rectangle { |