From d549f1ba32c391490abe34251ef60bb59df39f98 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Thu, 6 Apr 2017 13:20:47 +0200 Subject: introduce Kube.Popup --- framework/qml/AccountSwitcher.qml | 2 +- framework/qml/FocusComposer.qml | 3 +-- framework/qml/People.qml | 13 +++++-------- framework/qml/Popup.qml | 31 +++++++++++++++++++++++++++++++ framework/qmldir | 1 + 5 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 framework/qml/Popup.qml (limited to 'framework') diff --git a/framework/qml/AccountSwitcher.qml b/framework/qml/AccountSwitcher.qml index 2c5d572e..1fafba27 100644 --- a/framework/qml/AccountSwitcher.qml +++ b/framework/qml/AccountSwitcher.qml @@ -48,7 +48,7 @@ Controls.ToolButton { popup.open() } - Controls2.Popup { + Kube.Popup { id: popup height: listView.count == 0 ? Kirigami.Units.gridUnit * 4 : Kirigami.Units.gridUnit * 2 + listView.count * Kirigami.Units.gridUnit * 3 diff --git a/framework/qml/FocusComposer.qml b/framework/qml/FocusComposer.qml index 823ed32f..e827dbc2 100644 --- a/framework/qml/FocusComposer.qml +++ b/framework/qml/FocusComposer.qml @@ -24,7 +24,7 @@ import org.kde.kirigami 1.0 as Kirigami import org.kube.framework 1.0 as Kube -Controls2.Popup { +Kube.Popup { id: root //Controller @@ -59,7 +59,6 @@ Controls2.Popup { anchors { fill: parent - margins: Kirigami.Units.largeSpacing } ColumnLayout { diff --git a/framework/qml/People.qml b/framework/qml/People.qml index 8ccd174d..1a2f15b2 100644 --- a/framework/qml/People.qml +++ b/framework/qml/People.qml @@ -26,7 +26,7 @@ import org.kde.kirigami 1.0 as Kirigami import org.kube.framework 1.0 as Kube -Popup { +Kube.Popup { id: popup property var currentContact @@ -38,15 +38,13 @@ Popup { anchors.fill: parent - ToolBar { + Item { id: toolbar + height: searchBar.height + Kube.Units.smallSpacing width: parent.width Controls.ToolButton { - - anchors.verticalCenter: parent.verticalCenter - iconName: Kube.Icons.goBack onClicked: stack.pop() @@ -56,7 +54,8 @@ Popup { TextField { id: searchBar - anchors.centerIn: parent + + anchors.horizontalCenter: parent.horizontalCenter placeholderText: "Search..." @@ -64,11 +63,9 @@ Popup { } Controls.ToolButton { - anchors { right: parent.right rightMargin: Kube.Units.smallSpacing - verticalCenter: parent.verticalCenter } iconName: Kube.Icons.addNew diff --git a/framework/qml/Popup.qml b/framework/qml/Popup.qml new file mode 100644 index 00000000..6a74fd12 --- /dev/null +++ b/framework/qml/Popup.qml @@ -0,0 +1,31 @@ +/* + * 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.8 +import QtQuick.Templates 2.1 as T +import org.kube.framework 1.0 + +T.Popup { + id: root + + padding: Units.largeSpacing + + background: Rectangle { + color: Colors.backgroundColor + } +} diff --git a/framework/qmldir b/framework/qmldir index 74d0168d..1ca1cb72 100644 --- a/framework/qmldir +++ b/framework/qmldir @@ -14,6 +14,7 @@ People 1.0 People.qml NotificationPopup 1.0 NotificationPopup.qml Icon 1.0 Icon.qml Button 1.0 Button.qml +Popup 1.0 Popup.qml PositiveButton 1.0 PositiveButton.qml singleton Colors 1.0 Colors.qml singleton Icons 1.0 Icons.qml -- cgit v1.2.3