summaryrefslogtreecommitdiffstats
path: root/framework/qml/TextButton.qml
diff options
context:
space:
mode:
Diffstat (limited to 'framework/qml/TextButton.qml')
-rw-r--r--framework/qml/TextButton.qml43
1 files changed, 43 insertions, 0 deletions
diff --git a/framework/qml/TextButton.qml b/framework/qml/TextButton.qml
new file mode 100644
index 00000000..4d7ea27d
--- /dev/null
+++ b/framework/qml/TextButton.qml
@@ -0,0 +1,43 @@
1/*
2 * Copyright (C) 2017 Michael Bohlender, <bohlender@kolabsys.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19import QtQuick 2.7
20import QtQuick.Templates 2.0 as T
21import org.kube.framework 1.0
22
23T.Button {
24 id: root
25
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}