From 962f09c6f6ceedd96eced193360c1b106f555fac Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Wed, 19 Apr 2017 10:44:33 +0200 Subject: introduce Kube.Label and use it in kube controls --- framework/qml/Button.qml | 4 +--- framework/qml/Label.qml | 26 ++++++++++++++++++++++++++ framework/qml/PositiveButton.qml | 3 +-- framework/qml/TextField.qml | 4 ++-- framework/qml/Units.qml | 1 + 5 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 framework/qml/Label.qml (limited to 'framework/qml') 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 { } } - contentItem: Text { + contentItem: Label { text: root.text - //TODO font elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - color: Colors.textColor } } 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 @@ +/* + * 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. + */ + +import QtQuick 2.7 +import QtQuick.Templates 2.0 as T +import org.kube.framework 1.0 + +T.Label { + color: Colors.textColor + font.family: "Noto Sans" +} 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 { } } - contentItem: Text { + contentItem: Label { text: root.text - //TODO font elide: Text.ElideRight horizontalAlignment: Text.AlignHCenter 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 { padding: Units.smallSpacing color: Colors.textColor + font.family: "Noto Sans" - Text { + Label { id: placeholder x: root.leftPadding y: root.topPadding @@ -40,7 +41,6 @@ T.TextField { visible: root.text == "" text: root.placeholderText - //TODO font: color: Colors.disabledTextColor elide: Text.ElideRight } 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 { property int largeSpacing: gridUnit property variant fontMetrics: TextMetrics { text: "M" + font.family: "Noto Sans" } } -- cgit v1.2.3