diff options
-rw-r--r-- | framework/qml/IconButton.qml | 43 |
1 files changed, 7 insertions, 36 deletions
diff --git a/framework/qml/IconButton.qml b/framework/qml/IconButton.qml index f6b97090..302e51b0 100644 --- a/framework/qml/IconButton.qml +++ b/framework/qml/IconButton.qml | |||
@@ -17,49 +17,20 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | import QtQuick 2.4 | 19 | import QtQuick 2.4 |
20 | import QtQuick.Layouts 1.1 | 20 | import org.kube.framework 1.0 |
21 | import QtQuick.Templates 2.0 as T | ||
22 | import org.kube.framework 1.0 as Kube | ||
23 | 21 | ||
24 | T.Button { | 22 | AbstractButton { |
25 | id: root | 23 | id: root |
26 | 24 | ||
27 | property alias iconName: icon.iconName | 25 | property alias iconName: icon.iconName |
28 | 26 | ||
29 | width: Kube.Units.gridUnit + leftPadding + rightPadding | 27 | width: Units.gridUnit + leftPadding + rightPadding |
30 | height: Kube.Units.gridUnit + topPadding + bottomPadding | 28 | height: Units.gridUnit + topPadding + bottomPadding |
31 | 29 | ||
32 | padding: Kube.Units.smallSpacing | 30 | padding: Units.smallSpacing |
31 | color: "transparent" | ||
33 | 32 | ||
34 | clip: true | 33 | contentItem: Icon { |
35 | hoverEnabled: true | ||
36 | Keys.onReturnPressed: root.clicked() | ||
37 | |||
38 | background: Item { | ||
39 | Rectangle { | ||
40 | anchors.fill: parent | ||
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 | } | ||
53 | |||
54 | Rectangle { | ||
55 | anchors.fill: parent | ||
56 | visible: root.pressed | ||
57 | color: Kube.Colors.textColor | ||
58 | opacity: 0.2 | ||
59 | } | ||
60 | } | ||
61 | |||
62 | contentItem: Kube.Icon { | ||
63 | id: icon | 34 | id: icon |
64 | } | 35 | } |
65 | } | 36 | } |