summaryrefslogtreecommitdiffstats
path: root/framework/qml
diff options
context:
space:
mode:
Diffstat (limited to 'framework/qml')
-rw-r--r--framework/qml/Font.qml28
-rw-r--r--framework/qml/Label.qml6
-rw-r--r--framework/qml/TextField.qml18
-rw-r--r--framework/qml/Units.qml4
4 files changed, 43 insertions, 13 deletions
diff --git a/framework/qml/Font.qml b/framework/qml/Font.qml
new file mode 100644
index 00000000..b4abbe0d
--- /dev/null
+++ b/framework/qml/Font.qml
@@ -0,0 +1,28 @@
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
19pragma Singleton
20
21import QtQuick 2.7
22
23Item {
24 id: root
25
26 property string fontFamily: "Noto Sans"
27}
28
diff --git a/framework/qml/Label.qml b/framework/qml/Label.qml
index c7a71faa..cc8235a3 100644
--- a/framework/qml/Label.qml
+++ b/framework/qml/Label.qml
@@ -18,9 +18,9 @@
18 18
19import QtQuick 2.7 19import QtQuick 2.7
20import QtQuick.Templates 2.0 as T 20import QtQuick.Templates 2.0 as T
21import org.kube.framework 1.0 21import org.kube.framework 1.0 as Kube
22 22
23T.Label { 23T.Label {
24 color: Colors.textColor 24 color: Kube.Colors.textColor
25 font.family: "Noto Sans" 25 font.family: Kube.Font.fontFamily
26} 26}
diff --git a/framework/qml/TextField.qml b/framework/qml/TextField.qml
index dbf5dae7..a33ccc3a 100644
--- a/framework/qml/TextField.qml
+++ b/framework/qml/TextField.qml
@@ -18,18 +18,18 @@
18 18
19import QtQuick 2.7 19import QtQuick 2.7
20import QtQuick.Templates 2.0 as T 20import QtQuick.Templates 2.0 as T
21import org.kube.framework 1.0 21import org.kube.framework 1.0 as Kube
22 22
23T.TextField { 23T.TextField {
24 id: root 24 id: root
25 25
26 implicitHeight: Units.gridUnit + Units.smallSpacing * 2 26 implicitHeight: Kube.Units.gridUnit + Kube.Units.smallSpacing * 2
27 implicitWidth: Units.gridUnit * 5 + Units.smallSpacing * 2 27 implicitWidth: Kube.Units.gridUnit * 5 + Kube.Units.smallSpacing * 2
28 28
29 padding: Units.smallSpacing 29 padding: Kube.Units.smallSpacing
30 30
31 color: Colors.textColor 31 color: Kube.Colors.textColor
32 font.family: "Noto Sans" 32 font.family: Kube.Font.fontFamily
33 33
34 Label { 34 Label {
35 id: placeholder 35 id: placeholder
@@ -41,13 +41,13 @@ T.TextField {
41 41
42 visible: root.text == "" 42 visible: root.text == ""
43 text: root.placeholderText 43 text: root.placeholderText
44 color: Colors.disabledTextColor 44 color: Kube.Colors.disabledTextColor
45 elide: Text.ElideRight 45 elide: Text.ElideRight
46 } 46 }
47 47
48 background: Rectangle { 48 background: Rectangle {
49 color: Colors.viewBackgroundColor 49 color: Kube.Colors.viewBackgroundColor
50 border.width: 1 50 border.width: 1
51 border.color: Colors.buttonColor 51 border.color: Kube.Colors.buttonColor
52 } 52 }
53} 53}
diff --git a/framework/qml/Units.qml b/framework/qml/Units.qml
index a8eddd8d..8e8b5e83 100644
--- a/framework/qml/Units.qml
+++ b/framework/qml/Units.qml
@@ -20,14 +20,16 @@
20pragma Singleton 20pragma Singleton
21 21
22import QtQuick 2.7 22import QtQuick 2.7
23import org.kube.framework 1.0 as Kube
23 24
24Item { 25Item {
25 property int gridUnit: fontMetrics.height 26 property int gridUnit: fontMetrics.height
26 property int smallSpacing: gridUnit/4 27 property int smallSpacing: gridUnit/4
27 property int largeSpacing: gridUnit 28 property int largeSpacing: gridUnit
29
28 property variant fontMetrics: TextMetrics { 30 property variant fontMetrics: TextMetrics {
29 text: "M" 31 text: "M"
30 font.family: "Noto Sans" 32 font.family: Kube.Font.fontFamily
31 } 33 }
32} 34}
33 35