summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2017-04-19 10:44:33 +0200
committerMichael Bohlender <michael.bohlender@kdemail.net>2017-04-19 10:44:33 +0200
commit962f09c6f6ceedd96eced193360c1b106f555fac (patch)
treeac4103c97e110e16f1b476c7754e4bde5ab241e7
parent0190a9e9110951012cfeef9bc52dc78b1014b314 (diff)
downloadkube-962f09c6f6ceedd96eced193360c1b106f555fac.tar.gz
kube-962f09c6f6ceedd96eced193360c1b106f555fac.zip
introduce Kube.Label and use it in kube controls
-rw-r--r--framework/qml/Button.qml4
-rw-r--r--framework/qml/Label.qml26
-rw-r--r--framework/qml/PositiveButton.qml3
-rw-r--r--framework/qml/TextField.qml4
-rw-r--r--framework/qml/Units.qml1
-rw-r--r--framework/qmldir1
6 files changed, 32 insertions, 7 deletions
diff --git a/framework/qml/Button.qml b/framework/qml/Button.qml
index 181cf58b..6a3654cc 100644
--- a/framework/qml/Button.qml
+++ b/framework/qml/Button.qml
@@ -44,12 +44,10 @@ T.Button {
44 } 44 }
45 } 45 }
46 46
47 contentItem: Text { 47 contentItem: Label {
48 text: root.text 48 text: root.text
49 //TODO font
50 elide: Text.ElideRight 49 elide: Text.ElideRight
51 horizontalAlignment: Text.AlignHCenter 50 horizontalAlignment: Text.AlignHCenter
52 verticalAlignment: Text.AlignVCenter 51 verticalAlignment: Text.AlignVCenter
53 color: Colors.textColor
54 } 52 }
55} 53}
diff --git a/framework/qml/Label.qml b/framework/qml/Label.qml
new file mode 100644
index 00000000..c7a71faa
--- /dev/null
+++ b/framework/qml/Label.qml
@@ -0,0 +1,26 @@
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.Label {
24 color: Colors.textColor
25 font.family: "Noto Sans"
26}
diff --git a/framework/qml/PositiveButton.qml b/framework/qml/PositiveButton.qml
index 7c00a212..fb8aab9b 100644
--- a/framework/qml/PositiveButton.qml
+++ b/framework/qml/PositiveButton.qml
@@ -44,9 +44,8 @@ T.Button {
44 } 44 }
45 } 45 }
46 46
47 contentItem: Text { 47 contentItem: Label {
48 text: root.text 48 text: root.text
49 //TODO font
50 elide: Text.ElideRight 49 elide: Text.ElideRight
51 horizontalAlignment: Text.AlignHCenter 50 horizontalAlignment: Text.AlignHCenter
52 verticalAlignment: Text.AlignVCenter 51 verticalAlignment: Text.AlignVCenter
diff --git a/framework/qml/TextField.qml b/framework/qml/TextField.qml
index 688d0f5f..dbf5dae7 100644
--- a/framework/qml/TextField.qml
+++ b/framework/qml/TextField.qml
@@ -29,8 +29,9 @@ T.TextField {
29 padding: Units.smallSpacing 29 padding: Units.smallSpacing
30 30
31 color: Colors.textColor 31 color: Colors.textColor
32 font.family: "Noto Sans"
32 33
33 Text { 34 Label {
34 id: placeholder 35 id: placeholder
35 x: root.leftPadding 36 x: root.leftPadding
36 y: root.topPadding 37 y: root.topPadding
@@ -40,7 +41,6 @@ T.TextField {
40 41
41 visible: root.text == "" 42 visible: root.text == ""
42 text: root.placeholderText 43 text: root.placeholderText
43 //TODO font:
44 color: Colors.disabledTextColor 44 color: Colors.disabledTextColor
45 elide: Text.ElideRight 45 elide: Text.ElideRight
46 } 46 }
diff --git a/framework/qml/Units.qml b/framework/qml/Units.qml
index 96216f82..a8eddd8d 100644
--- a/framework/qml/Units.qml
+++ b/framework/qml/Units.qml
@@ -27,6 +27,7 @@ Item {
27 property int largeSpacing: gridUnit 27 property int largeSpacing: gridUnit
28 property variant fontMetrics: TextMetrics { 28 property variant fontMetrics: TextMetrics {
29 text: "M" 29 text: "M"
30 font.family: "Noto Sans"
30 } 31 }
31} 32}
32 33
diff --git a/framework/qmldir b/framework/qmldir
index 715f63dd..9f49a65f 100644
--- a/framework/qmldir
+++ b/framework/qmldir
@@ -18,6 +18,7 @@ Popup 1.0 Popup.qml
18ComboBox 1.0 ComboBox.qml 18ComboBox 1.0 ComboBox.qml
19PositiveButton 1.0 PositiveButton.qml 19PositiveButton 1.0 PositiveButton.qml
20TextField 1.0 TextField.qml 20TextField 1.0 TextField.qml
21Label 1.0 Label.qml
21singleton Colors 1.0 Colors.qml 22singleton Colors 1.0 Colors.qml
22singleton Icons 1.0 Icons.qml 23singleton Icons 1.0 Icons.qml
23singleton Units 1.0 Units.qml 24singleton Units 1.0 Units.qml