From 71b8f65dbb0d50e6545242f65a568a22c85f0fae Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Fri, 7 Apr 2017 09:54:17 +0200 Subject: Consistently give focus to popups In all cases we want the popup to receive keyboard focus when it's open, as all our popups are basically modal. We also want the popup to normally close when clicking somewhere else, including the parent button. The one exception is the composer where we disable the close on click outside because that would risk loosing a written mail on an accidental click. --- components/kube/contents/ui/Kube.qml | 3 --- framework/qml/AccountSwitcher.qml | 4 ---- framework/qml/FocusComposer.qml | 3 +-- framework/qml/Outbox.qml | 2 -- framework/qml/Popup.qml | 2 ++ 5 files changed, 3 insertions(+), 11 deletions(-) diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml index dedd13f1..41e970c6 100644 --- a/components/kube/contents/ui/Kube.qml +++ b/components/kube/contents/ui/Kube.qml @@ -420,9 +420,6 @@ Controls2.ApplicationWindow { x: app.width * 0.2 y: app.height * 0.2 - modal: true - focus: true - RowLayout { anchors.centerIn: parent width: parent.width diff --git a/framework/qml/AccountSwitcher.qml b/framework/qml/AccountSwitcher.qml index 2355d21c..b08983b3 100644 --- a/framework/qml/AccountSwitcher.qml +++ b/framework/qml/AccountSwitcher.qml @@ -56,10 +56,6 @@ Controls.ToolButton { y: accountSwitcher.y - height - modal: true - focus: true - closePolicy: Controls2.Popup.CloseOnEscape | Controls2.Popup.CloseOnPressOutsideParent - Item { id: buttons anchors { diff --git a/framework/qml/FocusComposer.qml b/framework/qml/FocusComposer.qml index 5900b809..08eafe36 100644 --- a/framework/qml/FocusComposer.qml +++ b/framework/qml/FocusComposer.qml @@ -46,8 +46,7 @@ Kube.Popup { } //END functions - modal: true - focus: true + //Don't close the composer due to an accidental click outside closePolicy: Controls2.Popup.CloseOnEscape | Controls2.Popup.CloseOnPressOutsideParent Item { diff --git a/framework/qml/Outbox.qml b/framework/qml/Outbox.qml index ad398337..e9e3c677 100644 --- a/framework/qml/Outbox.qml +++ b/framework/qml/Outbox.qml @@ -82,8 +82,6 @@ Rectangle { y: - dialog.height + root.height x: root.width - modal: true - Item { id: content diff --git a/framework/qml/Popup.qml b/framework/qml/Popup.qml index 084913e7..baba4933 100644 --- a/framework/qml/Popup.qml +++ b/framework/qml/Popup.qml @@ -29,4 +29,6 @@ T.Popup { background: Rectangle { color: Colors.backgroundColor } + focus: true + modal: true } -- cgit v1.2.3