summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2016-11-16 18:09:02 +0100
committerMichael Bohlender <michael.bohlender@kdemail.net>2016-11-16 18:09:02 +0100
commitc10ea09be56a1945c9025afaaf0c98b7c37657e7 (patch)
treeec4e2c21b657193a98d3400674534695a151b0b6
parent24b23c5373dc0ad26b8d803b1e4ae63cd49e1cd3 (diff)
downloadkube-c10ea09be56a1945c9025afaaf0c98b7c37657e7.tar.gz
kube-c10ea09be56a1945c9025afaaf0c98b7c37657e7.zip
make accountswitcher a qqc2 popup
-rw-r--r--components/mail/contents/ui/main.qml5
-rw-r--r--components/package/contents/ui/AccountSwitcher.qml27
2 files changed, 15 insertions, 17 deletions
diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml
index 405458c6..c891ea5f 100644
--- a/components/mail/contents/ui/main.qml
+++ b/components/mail/contents/ui/main.qml
@@ -20,6 +20,9 @@
20import QtQuick 2.7 20import QtQuick 2.7
21import QtQuick.Controls 1.3 21import QtQuick.Controls 1.3
22import QtQuick.Layouts 1.1 22import QtQuick.Layouts 1.1
23
24import QtQuick.Controls 2.0 as Controls2
25
23import org.kde.kirigami 1.0 as Kirigami 26import org.kde.kirigami 1.0 as Kirigami
24 27
25import org.kube.framework.actions 1.0 as KubeAction 28import org.kube.framework.actions 1.0 as KubeAction
@@ -27,7 +30,7 @@ import org.kube.framework.settings 1.0 as KubeSettings
27import org.kube.framework.domain 1.0 as KubeFramework 30import org.kube.framework.domain 1.0 as KubeFramework
28import org.kube.components 1.0 as KubeComponents 31import org.kube.components 1.0 as KubeComponents
29 32
30ApplicationWindow { 33Controls2.ApplicationWindow {
31 id: app 34 id: app
32 35
33 //FIXME remove fixed pixel hight 36 //FIXME remove fixed pixel hight
diff --git a/components/package/contents/ui/AccountSwitcher.qml b/components/package/contents/ui/AccountSwitcher.qml
index 8767e96e..14686665 100644
--- a/components/package/contents/ui/AccountSwitcher.qml
+++ b/components/package/contents/ui/AccountSwitcher.qml
@@ -20,6 +20,8 @@ import QtQuick 2.4
20import QtQuick.Controls 1.3 20import QtQuick.Controls 1.3
21import QtQuick.Layouts 1.1 21import QtQuick.Layouts 1.1
22 22
23import QtQuick.Controls 2.0 as Controls2
24
23import org.kde.kirigami 1.0 as Kirigami 25import org.kde.kirigami 1.0 as Kirigami
24 26
25import org.kube.framework.domain 1.0 as KubeFramework 27import org.kube.framework.domain 1.0 as KubeFramework
@@ -35,26 +37,21 @@ Button {
35 tooltip: "switch accounts, edit them and add new ones" 37 tooltip: "switch accounts, edit them and add new ones"
36 38
37 onClicked: { 39 onClicked: {
38 dialog.visible = dialog.visible ? false : true 40 popup.open()
39 } 41 }
40 42
41 Rectangle { 43 Controls2.Popup {
42 id: dialog 44 id: popup
43
44 anchors {
45 top: parent.bottom
46 left: parent.left
47 }
48 45
49 height: 300 46 height: 300
50 width: 600 47 width: 600
51 48
52 color: Kirigami.Theme.backgroundColor 49 x: parent.x
53 border.width: 1 50 y: parent.y + parent.height
54 border.color: Kirigami.Theme.highlightColor //TODO change to Kirigami inactive text color once it is available 51
55 radius: 3 52 modal: true
56 clip: true 53 focus: true
57 visible: false 54 closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
58 55
59 Item { 56 Item {
60 id: footer 57 id: footer
@@ -80,7 +77,6 @@ Button {
80 77
81 onClicked: { 78 onClicked: {
82 newAccountComponent.createObject(app) 79 newAccountComponent.createObject(app)
83 dialog.visible = false
84 } 80 }
85 81
86 Component { 82 Component {
@@ -105,7 +101,6 @@ Button {
105 101
106 onClicked: { 102 onClicked: {
107 syncAction.execute() 103 syncAction.execute()
108 dialog.visible = false
109 } 104 }
110 } 105 }
111 } 106 }