summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2017-05-31 11:46:46 +0200
committerMichael Bohlender <michael.bohlender@kdemail.net>2017-05-31 11:46:46 +0200
commiteec0167e9d4a60b871c19af04c5dcbb0985ab105 (patch)
tree3308be03d46e35362c1948779b562beab4c301a2
parent5b541813c5fc8d4e3ef259130eff8f9a03cf790d (diff)
downloadkube-eec0167e9d4a60b871c19af04c5dcbb0985ab105.tar.gz
kube-eec0167e9d4a60b871c19af04c5dcbb0985ab105.zip
focus visualisation for buttons
-rw-r--r--framework/qml/Button.qml5
-rw-r--r--framework/qml/PositiveButton.qml6
2 files changed, 9 insertions, 2 deletions
diff --git a/framework/qml/Button.qml b/framework/qml/Button.qml
index 664d9b3d..72b0e053 100644
--- a/framework/qml/Button.qml
+++ b/framework/qml/Button.qml
@@ -36,9 +36,12 @@ T.Button {
36 background: Rectangle { 36 background: Rectangle {
37 color: Colors.buttonColor 37 color: Colors.buttonColor
38 38
39 border.width: 2
40 border.color: root.focus ? Colors.highlightColor : Colors.buttonColor
41
39 Rectangle { 42 Rectangle {
40 anchors.fill: parent 43 anchors.fill: parent
41 visible: root.hovered || root.pressed || root.activeFocus 44 visible: root.hovered || root.pressed
42 color: root.pressed ? Colors.textColor : Colors.viewBackgroundColor 45 color: root.pressed ? Colors.textColor : Colors.viewBackgroundColor
43 opacity: 0.2 46 opacity: 0.2
44 } 47 }
diff --git a/framework/qml/PositiveButton.qml b/framework/qml/PositiveButton.qml
index 7ec2e2c8..01588d97 100644
--- a/framework/qml/PositiveButton.qml
+++ b/framework/qml/PositiveButton.qml
@@ -36,9 +36,12 @@ T.Button {
36 background: Rectangle { 36 background: Rectangle {
37 color: Colors.positiveColor 37 color: Colors.positiveColor
38 38
39 border.width: 2
40 border.color: root.focus ? Colors.highlightColor : Colors.positiveColor
41
39 Rectangle { 42 Rectangle {
40 anchors.fill: parent 43 anchors.fill: parent
41 visible: root.hovered || root.pressed || root.activeFocus 44 visible: root.hovered || root.pressed
42 color: root.pressed ? Colors.textColor : Colors.viewBackgroundColor 45 color: root.pressed ? Colors.textColor : Colors.viewBackgroundColor
43 opacity: 0.2 46 opacity: 0.2
44 } 47 }
@@ -46,6 +49,7 @@ T.Button {
46 49
47 contentItem: Label { 50 contentItem: Label {
48 text: root.text 51 text: root.text
52 font.underline: root.focus
49 elide: Text.ElideRight 53 elide: Text.ElideRight
50 horizontalAlignment: Text.AlignHCenter 54 horizontalAlignment: Text.AlignHCenter
51 verticalAlignment: Text.AlignVCenter 55 verticalAlignment: Text.AlignVCenter