From 1d4952b09a48c6107497cc37d644b231fd5b22eb Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Tue, 4 Apr 2017 10:27:24 +0200 Subject: add positivebutton component --- components/mail/contents/ui/Mail.qml | 7 ++-- components/package/contents/ui/PositiveButton.qml | 47 +++++++++++++++++++++++ components/qmldir | 1 + 3 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 components/package/contents/ui/PositiveButton.qml diff --git a/components/mail/contents/ui/Mail.qml b/components/mail/contents/ui/Mail.qml index af006c1b..6a450d7f 100644 --- a/components/mail/contents/ui/Mail.qml +++ b/components/mail/contents/ui/Mail.qml @@ -209,17 +209,18 @@ Controls2.ApplicationWindow { } } - KubeComponents.Button { + KubeComponents.PositiveButton { id: newMailButton + anchors { top: toolBar.bottom left: parent.left right: parent.right margins: KubeTheme.Units.largeSpacing } - color: KubeTheme.Colors.positveColor - height: KubeTheme.Units.gridUnit * 1.5 + text: qsTr("New Email") + onClicked: { composer.open() } diff --git a/components/package/contents/ui/PositiveButton.qml b/components/package/contents/ui/PositiveButton.qml new file mode 100644 index 00000000..83063668 --- /dev/null +++ b/components/package/contents/ui/PositiveButton.qml @@ -0,0 +1,47 @@ +/* + * 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.Controls 2.1 as Controls +import org.kube.components.theme 1.0 as KubeTheme + +Controls.AbstractButton { + id: root + + width: mainText.implicitWidth + KubeTheme.Units.largeSpacing * 2 + height: mainText.implicitHeight + KubeTheme.Units.smallSpacing * 2 + + clip: true + + Rectangle { + id: background + + anchors.fill: parent + + color: KubeTheme.Colors.positveColor + } + + Text { + id: mainText + + anchors.centerIn: parent + + color: KubeTheme.Colors.highlightedTextColor + text: root.text + } +} diff --git a/components/qmldir b/components/qmldir index 90379baf..a1c09b87 100644 --- a/components/qmldir +++ b/components/qmldir @@ -14,3 +14,4 @@ People 1.0 People.qml Notification 1.0 Notification.qml Icon 1.0 Icon.qml Button 1.0 Button.qml +PositiveButton 1.0 PositiveButton.qml -- cgit v1.2.3