From 30cea9381ea977e4c4a7b2a6378a32802f075ea8 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 20 Apr 2017 08:14:44 +0200 Subject: introduce Kube.Font --- framework/qml/Font.qml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 framework/qml/Font.qml (limited to 'framework/qml') 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 @@ +/* + Copyright (C) 2017 Michael Bohlender, + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +pragma Singleton + +import QtQuick 2.7 + +Item { + id: root + + property string fontFamily: "Noto Sans" +} + -- cgit v1.2.3 From 6ca09078e4597bdd97b166266428af7e0b211737 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 20 Apr 2017 08:16:14 +0200 Subject: use Kube.Font in Units --- framework/qml/Units.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'framework/qml') 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 @@ pragma Singleton import QtQuick 2.7 +import org.kube.framework 1.0 as Kube Item { property int gridUnit: fontMetrics.height property int smallSpacing: gridUnit/4 property int largeSpacing: gridUnit + property variant fontMetrics: TextMetrics { text: "M" - font.family: "Noto Sans" + font.family: Kube.Font.fontFamily } } -- cgit v1.2.3 From 7d03e68d712320af80548c8b0a4e6c6e53ab3e27 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 20 Apr 2017 08:16:58 +0200 Subject: use Kube.Font in Label --- framework/qml/Label.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'framework/qml') 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 @@ import QtQuick 2.7 import QtQuick.Templates 2.0 as T -import org.kube.framework 1.0 +import org.kube.framework 1.0 as Kube T.Label { - color: Colors.textColor - font.family: "Noto Sans" + color: Kube.Colors.textColor + font.family: Kube.Font.fontFamily } -- cgit v1.2.3 From 41ff2e66bf4768398a6d1e5d8ae42f60a81f44a1 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 20 Apr 2017 08:17:37 +0200 Subject: use Kube.Font in textfield --- framework/qml/TextField.qml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'framework/qml') 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 @@ import QtQuick 2.7 import QtQuick.Templates 2.0 as T -import org.kube.framework 1.0 +import org.kube.framework 1.0 as Kube T.TextField { id: root - implicitHeight: Units.gridUnit + Units.smallSpacing * 2 - implicitWidth: Units.gridUnit * 5 + Units.smallSpacing * 2 + implicitHeight: Kube.Units.gridUnit + Kube.Units.smallSpacing * 2 + implicitWidth: Kube.Units.gridUnit * 5 + Kube.Units.smallSpacing * 2 - padding: Units.smallSpacing + padding: Kube.Units.smallSpacing - color: Colors.textColor - font.family: "Noto Sans" + color: Kube.Colors.textColor + font.family: Kube.Font.fontFamily Label { id: placeholder @@ -41,13 +41,13 @@ T.TextField { visible: root.text == "" text: root.placeholderText - color: Colors.disabledTextColor + color: Kube.Colors.disabledTextColor elide: Text.ElideRight } background: Rectangle { - color: Colors.viewBackgroundColor + color: Kube.Colors.viewBackgroundColor border.width: 1 - border.color: Colors.buttonColor + border.color: Kube.Colors.buttonColor } } -- cgit v1.2.3