From c10ea09be56a1945c9025afaaf0c98b7c37657e7 Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Wed, 16 Nov 2016 18:09:02 +0100 Subject: make accountswitcher a qqc2 popup --- components/mail/contents/ui/main.qml | 5 +++- components/package/contents/ui/AccountSwitcher.qml | 27 +++++++++------------- 2 files changed, 15 insertions(+), 17 deletions(-) (limited to 'components') 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 @@ import QtQuick 2.7 import QtQuick.Controls 1.3 import QtQuick.Layouts 1.1 + +import QtQuick.Controls 2.0 as Controls2 + import org.kde.kirigami 1.0 as Kirigami import org.kube.framework.actions 1.0 as KubeAction @@ -27,7 +30,7 @@ import org.kube.framework.settings 1.0 as KubeSettings import org.kube.framework.domain 1.0 as KubeFramework import org.kube.components 1.0 as KubeComponents -ApplicationWindow { +Controls2.ApplicationWindow { id: app //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 import QtQuick.Controls 1.3 import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.0 as Controls2 + import org.kde.kirigami 1.0 as Kirigami import org.kube.framework.domain 1.0 as KubeFramework @@ -35,26 +37,21 @@ Button { tooltip: "switch accounts, edit them and add new ones" onClicked: { - dialog.visible = dialog.visible ? false : true + popup.open() } - Rectangle { - id: dialog - - anchors { - top: parent.bottom - left: parent.left - } + Controls2.Popup { + id: popup height: 300 width: 600 - color: Kirigami.Theme.backgroundColor - border.width: 1 - border.color: Kirigami.Theme.highlightColor //TODO change to Kirigami inactive text color once it is available - radius: 3 - clip: true - visible: false + x: parent.x + y: parent.y + parent.height + + modal: true + focus: true + closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent Item { id: footer @@ -80,7 +77,6 @@ Button { onClicked: { newAccountComponent.createObject(app) - dialog.visible = false } Component { @@ -105,7 +101,6 @@ Button { onClicked: { syncAction.execute() - dialog.visible = false } } } -- cgit v1.2.3