diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2016-02-01 15:20:59 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2016-02-09 11:26:46 +0000 |
commit | 01405a2515243d81b4a7718dacb879eb5fd7cc92 (patch) | |
tree | 2625539ae19c5c595667800b4448b9d71eb11b61 /wayland/democompositor/qml/TimedButton.qml | |
parent | 19acec2796c26bd902472ddd87858fac4d20ada4 (diff) |
Initial implementation of Diana's design
Based on the screenshots. Not using exact values for sizes
and distances.
Change-Id: I37c9593b776f4fb6f98ab4b8b571357f182ee65a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'wayland/democompositor/qml/TimedButton.qml')
-rw-r--r-- | wayland/democompositor/qml/TimedButton.qml | 62 |
1 files changed, 49 insertions, 13 deletions
diff --git a/wayland/democompositor/qml/TimedButton.qml b/wayland/democompositor/qml/TimedButton.qml index 2134e4d..af023c4 100644 --- a/wayland/democompositor/qml/TimedButton.qml +++ b/wayland/democompositor/qml/TimedButton.qml @@ -39,8 +39,12 @@ import QtQuick 2.6 Rectangle { id: theButton - radius: 10 - color: "lightgray" + //radius: 10 + color: "magenta" + property color grooveColor: "cyan" + property color textColor: "#777" + property alias icon: iconImage + property double iconSize: 32 property alias text: buttonText.text signal triggered() @@ -83,24 +87,56 @@ Rectangle { } ] Rectangle { - radius: 10 - color: "red" - anchors.left: parent.left + id: timeIndicator anchors.top: parent.top - anchors.bottom: parent.bottom - width: parent.width * percent / 100 - visible: percent > 0 + anchors.left: parent.left + anchors.right: parent.right + height: 10 + color: grooveColor + Rectangle { + color: "#e41e25" + anchors.left: parent.left + anchors.top: parent.top + anchors.bottom: parent.bottom + width: parent.width * percent / 100 + visible: percent > 0 + } } - Text { - id: buttonText - anchors.verticalCenter: parent.verticalCenter + Item { + anchors.top: timeIndicator.bottom + anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right - anchors.margins: 10 - text: "[Uninitialized]" + Item { + id: iconRect + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: 5 + width: iconSize + height: iconSize + Image { + anchors.centerIn: parent + id: iconImage + } + } + + + Text { + id: buttonText + anchors.verticalCenter: parent.verticalCenter + anchors.left: iconRect.right + anchors.right: parent.right + anchors.leftMargin: 10 + + color: textColor + text: "[Uninitialized]" + font.bold: true + } + } + MouseArea { id: mouser anchors.fill: parent |