diff options
author | Michael Bohlender <michael.bohlender@kdemail.net> | 2016-11-16 18:09:02 +0100 |
---|---|---|
committer | Michael Bohlender <michael.bohlender@kdemail.net> | 2016-11-16 18:09:02 +0100 |
commit | c10ea09be56a1945c9025afaaf0c98b7c37657e7 (patch) | |
tree | ec4e2c21b657193a98d3400674534695a151b0b6 | |
parent | 24b23c5373dc0ad26b8d803b1e4ae63cd49e1cd3 (diff) | |
download | kube-c10ea09be56a1945c9025afaaf0c98b7c37657e7.tar.gz kube-c10ea09be56a1945c9025afaaf0c98b7c37657e7.zip |
make accountswitcher a qqc2 popup
-rw-r--r-- | components/mail/contents/ui/main.qml | 5 | ||||
-rw-r--r-- | components/package/contents/ui/AccountSwitcher.qml | 27 |
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 @@ | |||
20 | import QtQuick 2.7 | 20 | import QtQuick 2.7 |
21 | import QtQuick.Controls 1.3 | 21 | import QtQuick.Controls 1.3 |
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 |
23 | |||
24 | import QtQuick.Controls 2.0 as Controls2 | ||
25 | |||
23 | import org.kde.kirigami 1.0 as Kirigami | 26 | import org.kde.kirigami 1.0 as Kirigami |
24 | 27 | ||
25 | import org.kube.framework.actions 1.0 as KubeAction | 28 | import org.kube.framework.actions 1.0 as KubeAction |
@@ -27,7 +30,7 @@ import org.kube.framework.settings 1.0 as KubeSettings | |||
27 | import org.kube.framework.domain 1.0 as KubeFramework | 30 | import org.kube.framework.domain 1.0 as KubeFramework |
28 | import org.kube.components 1.0 as KubeComponents | 31 | import org.kube.components 1.0 as KubeComponents |
29 | 32 | ||
30 | ApplicationWindow { | 33 | Controls2.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 | |||
20 | import QtQuick.Controls 1.3 | 20 | import QtQuick.Controls 1.3 |
21 | import QtQuick.Layouts 1.1 | 21 | import QtQuick.Layouts 1.1 |
22 | 22 | ||
23 | import QtQuick.Controls 2.0 as Controls2 | ||
24 | |||
23 | import org.kde.kirigami 1.0 as Kirigami | 25 | import org.kde.kirigami 1.0 as Kirigami |
24 | 26 | ||
25 | import org.kube.framework.domain 1.0 as KubeFramework | 27 | import 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 | } |