diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2017-04-20 08:43:51 +0200 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2017-04-20 08:43:51 +0200 |
commit | 8e2fd6ecd38195ef703143515f78ab8e7f132139 (patch) | |
tree | 9d0262cadadd64563c19b53fdf4edae457da9b12 /framework | |
parent | f373659e6ba28934f07ffd4a67d005f82fe59ba4 (diff) | |
parent | 41ff2e66bf4768398a6d1e5d8ae42f60a81f44a1 (diff) | |
download | kube-8e2fd6ecd38195ef703143515f78ab8e7f132139.tar.gz kube-8e2fd6ecd38195ef703143515f78ab8e7f132139.zip |
Merge branch 'mbohlender/fonts' into develop
Diffstat (limited to 'framework')
-rw-r--r-- | framework/qml/Font.qml | 28 | ||||
-rw-r--r-- | framework/qml/Label.qml | 6 | ||||
-rw-r--r-- | framework/qml/TextField.qml | 18 | ||||
-rw-r--r-- | framework/qml/Units.qml | 4 | ||||
-rw-r--r-- | framework/qmldir | 2 |
5 files changed, 45 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 | |||
19 | pragma Singleton | ||
20 | |||
21 | import QtQuick 2.7 | ||
22 | |||
23 | Item { | ||
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 | ||
19 | import QtQuick 2.7 | 19 | import QtQuick 2.7 |
20 | import QtQuick.Templates 2.0 as T | 20 | import QtQuick.Templates 2.0 as T |
21 | import org.kube.framework 1.0 | 21 | import org.kube.framework 1.0 as Kube |
22 | 22 | ||
23 | T.Label { | 23 | T.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 | ||
19 | import QtQuick 2.7 | 19 | import QtQuick 2.7 |
20 | import QtQuick.Templates 2.0 as T | 20 | import QtQuick.Templates 2.0 as T |
21 | import org.kube.framework 1.0 | 21 | import org.kube.framework 1.0 as Kube |
22 | 22 | ||
23 | T.TextField { | 23 | T.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 @@ | |||
20 | pragma Singleton | 20 | pragma Singleton |
21 | 21 | ||
22 | import QtQuick 2.7 | 22 | import QtQuick 2.7 |
23 | import org.kube.framework 1.0 as Kube | ||
23 | 24 | ||
24 | Item { | 25 | Item { |
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 | ||
diff --git a/framework/qmldir b/framework/qmldir index 9f49a65f..1cc25b18 100644 --- a/framework/qmldir +++ b/framework/qmldir | |||
@@ -22,5 +22,7 @@ Label 1.0 Label.qml | |||
22 | singleton Colors 1.0 Colors.qml | 22 | singleton Colors 1.0 Colors.qml |
23 | singleton Icons 1.0 Icons.qml | 23 | singleton Icons 1.0 Icons.qml |
24 | singleton Units 1.0 Units.qml | 24 | singleton Units 1.0 Units.qml |
25 | singleton Font 1.0 Font.qml | ||
26 | |||
25 | 27 | ||
26 | plugin frameworkplugin | 28 | plugin frameworkplugin |