diff options
Diffstat (limited to 'framework/qml/Button.qml')
-rw-r--r-- | framework/qml/Button.qml | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/framework/qml/Button.qml b/framework/qml/Button.qml index 80b7451a..f3251f4f 100644 --- a/framework/qml/Button.qml +++ b/framework/qml/Button.qml | |||
@@ -16,43 +16,7 @@ | |||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | import QtQuick 2.7 | ||
20 | import QtQuick.Templates 2.0 as T | ||
21 | import org.kube.framework 1.0 | 19 | import org.kube.framework 1.0 |
22 | 20 | ||
23 | T.Button { | 21 | AbstractButton { |
24 | id: root | ||
25 | |||
26 | width: Math.max(Units.gridUnit, contentItem.implicitWidth + leftPadding + rightPadding) | ||
27 | height: contentItem.implicitHeight + Units.smallSpacing * 2 | ||
28 | |||
29 | padding: Units.largeSpacing | ||
30 | topPadding: Units.smallSpacing * 2 | ||
31 | bottomPadding: Units.smallSpacing *2 | ||
32 | |||
33 | clip: true | ||
34 | hoverEnabled: true | ||
35 | Keys.onReturnPressed: root.clicked() | ||
36 | |||
37 | background: Rectangle { | ||
38 | color: Colors.buttonColor | ||
39 | |||
40 | border.width: 2 | ||
41 | border.color: root.activeFocus && !root.pressed ? Colors.highlightColor : Colors.buttonColor | ||
42 | |||
43 | Rectangle { | ||
44 | anchors.fill: parent | ||
45 | visible: root.hovered || root.pressed | ||
46 | color: root.pressed ? Colors.textColor : Colors.viewBackgroundColor | ||
47 | opacity: 0.2 | ||
48 | } | ||
49 | } | ||
50 | |||
51 | contentItem: Label { | ||
52 | text: root.text | ||
53 | font.underline: root.activeFocus | ||
54 | elide: Text.ElideRight | ||
55 | horizontalAlignment: Text.AlignHCenter | ||
56 | verticalAlignment: Text.AlignVCenter | ||
57 | } | ||
58 | } | 22 | } |