From bd4dc4fdcfd5dc365892846bdd09f23ba747bce9 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 29 Jun 2017 16:08:15 +0200 Subject: introduce Kube.Heading --- components/accounts/contents/ui/AccountWizard.qml | 3 +-- .../accounts/contents/ui/AccountWizardPage.qml | 3 +-- framework/qml/EditAccount.qml | 3 +-- framework/qml/Heading.qml | 27 ++++++++++++++++++++++ framework/qml/People.qml | 3 +-- framework/qml/Units.qml | 2 ++ framework/qmldir | 1 + 7 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 framework/qml/Heading.qml diff --git a/components/accounts/contents/ui/AccountWizard.qml b/components/accounts/contents/ui/AccountWizard.qml index 26001162..698f1d19 100644 --- a/components/accounts/contents/ui/AccountWizard.qml +++ b/components/accounts/contents/ui/AccountWizard.qml @@ -42,8 +42,7 @@ Kube.Popup { id: mainView Item { - //TODO Kube.Heading - Kube.Label { + Kube.Heading { id: heading text: "Select your new account type" color: Kube.Colors.highlightColor diff --git a/components/accounts/contents/ui/AccountWizardPage.qml b/components/accounts/contents/ui/AccountWizardPage.qml index 12d8efd8..f0a49b10 100644 --- a/components/accounts/contents/ui/AccountWizardPage.qml +++ b/components/accounts/contents/ui/AccountWizardPage.qml @@ -52,8 +52,7 @@ Item { bottom: parent.bottom } - //TODO Kube.Heading - Kube.Label { + Kube.Heading { id: heading text: loader.item.heading color: Kube.Colors.highlightColor diff --git a/framework/qml/EditAccount.qml b/framework/qml/EditAccount.qml index dfda020e..290cd5dc 100644 --- a/framework/qml/EditAccount.qml +++ b/framework/qml/EditAccount.qml @@ -38,8 +38,7 @@ Item { margins: Kube.Units.largeSpacing * 2 } - //TODO Kube.Heading - Kube.Label { + Kube.Heading { id: heading text: loader.item.heading color: Kube.Colors.highlightColor diff --git a/framework/qml/Heading.qml b/framework/qml/Heading.qml new file mode 100644 index 00000000..803c1488 --- /dev/null +++ b/framework/qml/Heading.qml @@ -0,0 +1,27 @@ +/* + * 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 as Kube + +T.Label { + color: Kube.Colors.textColor + font.family: Kube.Font.fontFamily + font.pointSize: Kube.Units.defaultFontSize * 2 +} diff --git a/framework/qml/People.qml b/framework/qml/People.qml index f67d55f1..7f36193e 100644 --- a/framework/qml/People.qml +++ b/framework/qml/People.qml @@ -269,8 +269,7 @@ Item { color: "lightgrey" } - //TODO replace with Kube.Heading once it is there - Kube.Label { + Kube.Heading { id: nameLabel anchors { diff --git a/framework/qml/Units.qml b/framework/qml/Units.qml index 8e8b5e83..6d66bf5c 100644 --- a/framework/qml/Units.qml +++ b/framework/qml/Units.qml @@ -27,6 +27,8 @@ Item { property int smallSpacing: gridUnit/4 property int largeSpacing: gridUnit + property int defaultFontSize: fontMetrics.font.pointSize + property variant fontMetrics: TextMetrics { text: "M" font.family: Kube.Font.fontFamily diff --git a/framework/qmldir b/framework/qmldir index 4328548b..0e7768c4 100644 --- a/framework/qmldir +++ b/framework/qmldir @@ -25,6 +25,7 @@ TextField 1.0 TextField.qml TextArea 1.0 TextArea.qml TextEditor 1.0 TextEditor.qml Label 1.0 Label.qml +Heading 1.0 Heading.qml View 1.0 View.qml AutocompleteLineEdit 1.0 AutocompleteLineEdit.qml AttachmentDelegate 1.0 AttachmentDelegate.qml -- cgit v1.2.3