diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-23 20:05:31 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-07-23 20:05:31 +0200 |
commit | fa790f59ec52b36ef4c25905073c3b0069deb08d (patch) | |
tree | b59099592e7098b8c42481bba55acda77e902569 /components | |
parent | dc50471a72c9310db3dd9149be1311e9502bdd9f (diff) | |
download | kube-fa790f59ec52b36ef4c25905073c3b0069deb08d.tar.gz kube-fa790f59ec52b36ef4c25905073c3b0069deb08d.zip |
Keyboard focus handling
Diffstat (limited to 'components')
-rw-r--r-- | components/kube/contents/ui/AddresseeListEditor.qml | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/components/kube/contents/ui/AddresseeListEditor.qml b/components/kube/contents/ui/AddresseeListEditor.qml index 1f106dfd..25916315 100644 --- a/components/kube/contents/ui/AddresseeListEditor.qml +++ b/components/kube/contents/ui/AddresseeListEditor.qml | |||
@@ -24,7 +24,7 @@ import QtQuick.Layouts 1.1 | |||
24 | 24 | ||
25 | import org.kube.framework 1.0 as Kube | 25 | import org.kube.framework 1.0 as Kube |
26 | 26 | ||
27 | Item { | 27 | FocusScope { |
28 | id: root | 28 | id: root |
29 | property variant completer | 29 | property variant completer |
30 | property alias model: listView.model | 30 | property alias model: listView.model |
@@ -78,14 +78,16 @@ Item { | |||
78 | } | 78 | } |
79 | } | 79 | } |
80 | 80 | ||
81 | Item { | 81 | FocusScope { |
82 | height: Kube.Units.gridUnit * Kube.Units.smallSpacing * 2 | 82 | height: Kube.Units.gridUnit * Kube.Units.smallSpacing * 2 |
83 | width: parent.width | 83 | width: parent.width |
84 | focus: true | ||
84 | 85 | ||
85 | Kube.TextButton { | 86 | Kube.TextButton { |
86 | id: button | 87 | id: button |
87 | text: "+ " + qsTr("Add recipient") | 88 | text: "+ " + qsTr("Add recipient") |
88 | color: Kube.Colors.highlightColor | 89 | color: Kube.Colors.highlightColor |
90 | focus: true | ||
89 | onClicked: { | 91 | onClicked: { |
90 | lineEdit.visible = true | 92 | lineEdit.visible = true |
91 | lineEdit.forceActiveFocus() | 93 | lineEdit.forceActiveFocus() |
@@ -107,6 +109,12 @@ Item { | |||
107 | root.added(text); | 109 | root.added(text); |
108 | clear() | 110 | clear() |
109 | visible = false | 111 | visible = false |
112 | button.forceActiveFocus() | ||
113 | } | ||
114 | onAborted: { | ||
115 | clear() | ||
116 | visible = false | ||
117 | button.forceActiveFocus() | ||
110 | } | 118 | } |
111 | } | 119 | } |
112 | } | 120 | } |