summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2017-04-06 13:20:47 +0200
committerMichael Bohlender <michael.bohlender@kdemail.net>2017-04-06 13:20:47 +0200
commitd549f1ba32c391490abe34251ef60bb59df39f98 (patch)
tree78dd7815df8675a9ba97d96425323dafcfff41fd
parent872bb7b30eeba9147f7b029fd88456679eb9f854 (diff)
downloadkube-d549f1ba32c391490abe34251ef60bb59df39f98.tar.gz
kube-d549f1ba32c391490abe34251ef60bb59df39f98.zip
introduce Kube.Popup
-rw-r--r--components/kube/contents/ui/Kube.qml5
-rw-r--r--framework/qml/AccountSwitcher.qml2
-rw-r--r--framework/qml/FocusComposer.qml3
-rw-r--r--framework/qml/People.qml13
-rw-r--r--framework/qml/Popup.qml31
-rw-r--r--framework/qmldir1
6 files changed, 42 insertions, 13 deletions
diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml
index 598cc6bc..9f7f68a3 100644
--- a/components/kube/contents/ui/Kube.qml
+++ b/components/kube/contents/ui/Kube.qml
@@ -411,7 +411,7 @@ Controls2.ApplicationWindow {
411 //END Notification 411 //END Notification
412 412
413 //BEGIN Search 413 //BEGIN Search
414 Controls2.Popup { 414 Kube.Popup {
415 id: search 415 id: search
416 416
417 width: app.width * 0.6 417 width: app.width * 0.6
@@ -424,7 +424,8 @@ Controls2.ApplicationWindow {
424 focus: true 424 focus: true
425 425
426 RowLayout { 426 RowLayout {
427 anchors.fill: parent 427 anchors.centerIn: parent
428 width: parent.width
428 429
429 Controls2.TextField { 430 Controls2.TextField {
430 id: searchField 431 id: searchField
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 {
48 popup.open() 48 popup.open()
49 } 49 }
50 50
51 Controls2.Popup { 51 Kube.Popup {
52 id: popup 52 id: popup
53 53
54 height: listView.count == 0 ? Kirigami.Units.gridUnit * 4 : Kirigami.Units.gridUnit * 2 + listView.count * Kirigami.Units.gridUnit * 3 54 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
24import org.kube.framework 1.0 as Kube 24import org.kube.framework 1.0 as Kube
25 25
26 26
27Controls2.Popup { 27Kube.Popup {
28 id: root 28 id: root
29 29
30 //Controller 30 //Controller
@@ -59,7 +59,6 @@ Controls2.Popup {
59 59
60 anchors { 60 anchors {
61 fill: parent 61 fill: parent
62 margins: Kirigami.Units.largeSpacing
63 } 62 }
64 63
65 ColumnLayout { 64 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
26import org.kube.framework 1.0 as Kube 26import org.kube.framework 1.0 as Kube
27 27
28 28
29Popup { 29Kube.Popup {
30 id: popup 30 id: popup
31 31
32 property var currentContact 32 property var currentContact
@@ -38,15 +38,13 @@ Popup {
38 38
39 anchors.fill: parent 39 anchors.fill: parent
40 40
41 ToolBar { 41 Item {
42 id: toolbar 42 id: toolbar
43 43
44 height: searchBar.height + Kube.Units.smallSpacing
44 width: parent.width 45 width: parent.width
45 46
46 Controls.ToolButton { 47 Controls.ToolButton {
47
48 anchors.verticalCenter: parent.verticalCenter
49
50 iconName: Kube.Icons.goBack 48 iconName: Kube.Icons.goBack
51 49
52 onClicked: stack.pop() 50 onClicked: stack.pop()
@@ -56,7 +54,8 @@ Popup {
56 54
57 TextField { 55 TextField {
58 id: searchBar 56 id: searchBar
59 anchors.centerIn: parent 57
58 anchors.horizontalCenter: parent.horizontalCenter
60 59
61 placeholderText: "Search..." 60 placeholderText: "Search..."
62 61
@@ -64,11 +63,9 @@ Popup {
64 } 63 }
65 64
66 Controls.ToolButton { 65 Controls.ToolButton {
67
68 anchors { 66 anchors {
69 right: parent.right 67 right: parent.right
70 rightMargin: Kube.Units.smallSpacing 68 rightMargin: Kube.Units.smallSpacing
71 verticalCenter: parent.verticalCenter
72 } 69 }
73 70
74 iconName: Kube.Icons.addNew 71 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 @@
1/*
2 * Copyright (C) 2017 Michael Bohlender, <bohlender@kolabsys.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19import QtQuick 2.8
20import QtQuick.Templates 2.1 as T
21import org.kube.framework 1.0
22
23T.Popup {
24 id: root
25
26 padding: Units.largeSpacing
27
28 background: Rectangle {
29 color: Colors.backgroundColor
30 }
31}
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
14NotificationPopup 1.0 NotificationPopup.qml 14NotificationPopup 1.0 NotificationPopup.qml
15Icon 1.0 Icon.qml 15Icon 1.0 Icon.qml
16Button 1.0 Button.qml 16Button 1.0 Button.qml
17Popup 1.0 Popup.qml
17PositiveButton 1.0 PositiveButton.qml 18PositiveButton 1.0 PositiveButton.qml
18singleton Colors 1.0 Colors.qml 19singleton Colors 1.0 Colors.qml
19singleton Icons 1.0 Icons.qml 20singleton Icons 1.0 Icons.qml