diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-25 01:11:46 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-25 01:11:46 +0200 |
commit | 26037ebce96b571037008f0234fea1535a40ae72 (patch) | |
tree | d281ecd6e085493b17c92316fb0e6998602aa5a8 | |
parent | 6a607fbe1523687ad106100dfa25ba9eeeaf8f13 (diff) | |
download | kube-26037ebce96b571037008f0234fea1535a40ae72.tar.gz kube-26037ebce96b571037008f0234fea1535a40ae72.zip |
TextButton based on AbstractButton
-rw-r--r-- | components/kube/contents/ui/AddresseeListEditor.qml | 2 | ||||
-rw-r--r-- | framework/qml/TextButton.qml | 25 |
2 files changed, 4 insertions, 23 deletions
diff --git a/components/kube/contents/ui/AddresseeListEditor.qml b/components/kube/contents/ui/AddresseeListEditor.qml index 25916315..adb2f785 100644 --- a/components/kube/contents/ui/AddresseeListEditor.qml +++ b/components/kube/contents/ui/AddresseeListEditor.qml | |||
@@ -86,7 +86,7 @@ FocusScope { | |||
86 | Kube.TextButton { | 86 | Kube.TextButton { |
87 | id: button | 87 | id: button |
88 | text: "+ " + qsTr("Add recipient") | 88 | text: "+ " + qsTr("Add recipient") |
89 | color: Kube.Colors.highlightColor | 89 | textColor: Kube.Colors.highlightColor |
90 | focus: true | 90 | focus: true |
91 | onClicked: { | 91 | onClicked: { |
92 | lineEdit.visible = true | 92 | lineEdit.visible = true |
diff --git a/framework/qml/TextButton.qml b/framework/qml/TextButton.qml index 4d7ea27d..ff4bf1a6 100644 --- a/framework/qml/TextButton.qml +++ b/framework/qml/TextButton.qml | |||
@@ -16,28 +16,9 @@ | |||
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 | 22 | color: "transparent" |
25 | 23 | padding: Units.smallSpacing | |
26 | property alias color: label.color | ||
27 | |||
28 | width: Math.max(Units.gridUnit, contentItem.implicitWidth + leftPadding + rightPadding) | ||
29 | height: contentItem.implicitHeight + topPadding + bottomPadding | ||
30 | |||
31 | clip: true | ||
32 | hoverEnabled: true | ||
33 | Keys.onReturnPressed: root.clicked() | ||
34 | |||
35 | contentItem: Label { | ||
36 | id: label | ||
37 | text: root.text | ||
38 | font.underline: root.activeFocus || root.hovered | ||
39 | elide: Text.ElideRight | ||
40 | horizontalAlignment: Text.AlignHCenter | ||
41 | verticalAlignment: Text.AlignVCenter | ||
42 | } | ||
43 | } | 24 | } |