From eec0167e9d4a60b871c19af04c5dcbb0985ab105 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Wed, 31 May 2017 11:46:46 +0200 Subject: focus visualisation for buttons --- framework/qml/Button.qml | 5 ++++- framework/qml/PositiveButton.qml | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'framework/qml') 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 { background: Rectangle { color: Colors.buttonColor + border.width: 2 + border.color: root.focus ? Colors.highlightColor : Colors.buttonColor + Rectangle { anchors.fill: parent - visible: root.hovered || root.pressed || root.activeFocus + visible: root.hovered || root.pressed color: root.pressed ? Colors.textColor : Colors.viewBackgroundColor opacity: 0.2 } 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 { background: Rectangle { color: Colors.positiveColor + border.width: 2 + border.color: root.focus ? Colors.highlightColor : Colors.positiveColor + Rectangle { anchors.fill: parent - visible: root.hovered || root.pressed || root.activeFocus + visible: root.hovered || root.pressed color: root.pressed ? Colors.textColor : Colors.viewBackgroundColor opacity: 0.2 } @@ -46,6 +49,7 @@ T.Button { contentItem: Label { text: root.text + font.underline: root.focus elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter -- cgit v1.2.3