diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-25 00:43:52 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-25 00:43:52 +0200 |
commit | 63f44f863809bb230cda405dc2c2e63b51e3c12b (patch) | |
tree | 2a7279efeccb8b5ae2f082bbb8e931d55071fba3 | |
parent | 63f170eb2eb3e29570f0e6969f5c69a05053518b (diff) | |
download | kube-63f44f863809bb230cda405dc2c2e63b51e3c12b.tar.gz kube-63f44f863809bb230cda405dc2c2e63b51e3c12b.zip |
Fixed IconButton focus highlighting
-rw-r--r-- | framework/qml/IconButton.qml | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/framework/qml/IconButton.qml b/framework/qml/IconButton.qml index 3be0b887..f6b97090 100644 --- a/framework/qml/IconButton.qml +++ b/framework/qml/IconButton.qml | |||
@@ -26,8 +26,8 @@ T.Button { | |||
26 | 26 | ||
27 | property alias iconName: icon.iconName | 27 | property alias iconName: icon.iconName |
28 | 28 | ||
29 | width: Kube.Units.gridUnit + padding * 2 | 29 | width: Kube.Units.gridUnit + leftPadding + rightPadding |
30 | height: Kube.Units.gridUnit + padding * 2 | 30 | height: Kube.Units.gridUnit + topPadding + bottomPadding |
31 | 31 | ||
32 | padding: Kube.Units.smallSpacing | 32 | padding: Kube.Units.smallSpacing |
33 | 33 | ||
@@ -35,15 +35,26 @@ T.Button { | |||
35 | hoverEnabled: true | 35 | hoverEnabled: true |
36 | Keys.onReturnPressed: root.clicked() | 36 | Keys.onReturnPressed: root.clicked() |
37 | 37 | ||
38 | background: Rectangle { | 38 | background: Item { |
39 | color: Kube.Colors.focusedButtonColor | 39 | Rectangle { |
40 | 40 | anchors.fill: parent | |
41 | visible: root.hovered || root.visualFocus | 41 | visible: root.checked |
42 | color: Kube.Colors.highlightColor | ||
43 | } | ||
44 | Rectangle { | ||
45 | anchors.fill: parent | ||
46 | visible: root.hovered || root.visualFocus | ||
47 | color: "transparent" | ||
48 | border { | ||
49 | width: 2 | ||
50 | color: Kube.Colors.focusedButtonColor | ||
51 | } | ||
52 | } | ||
42 | 53 | ||
43 | Rectangle { | 54 | Rectangle { |
44 | anchors.fill: parent | 55 | anchors.fill: parent |
45 | visible: root.hovered || root.pressed | 56 | visible: root.pressed |
46 | color: root.pressed ? Kube.Colors.textColor : Kube.Colors.viewBackgroundColor | 57 | color: Kube.Colors.textColor |
47 | opacity: 0.2 | 58 | opacity: 0.2 |
48 | } | 59 | } |
49 | } | 60 | } |