aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-09-29 19:52:55 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-26 18:34:44 +0000
commite711ce99c8cafe2e7c1d81a20a280f3029c98ccb (patch)
tree877e197d342ff2bb07cf9d35bcc4487bf5c70f29 /examples
parenta66e08da7681f7301e23c55fd1f40ef8461f0896 (diff)
Gallery: make the drawer usable with keyboard
Give it focus, and remove the check for the current index. It's a leftover from the days when Gallery used to replace the current page instead of doing a push. It looked silly to replace a page with the same page. This can no longer happen, because the drawer is not even accessible when navigated to a control page. And when navigating the drawer with keyboard, it is exactly the current item that must be triggered when you hit the spacebar. :) Change-Id: I00b48fbe4dd61b06041cb0c3370dfa9c12505dcf Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/quickcontrols2/gallery/gallery.qml8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/quickcontrols2/gallery/gallery.qml b/examples/quickcontrols2/gallery/gallery.qml
index 0d1c89f0..aadbcdec 100644
--- a/examples/quickcontrols2/gallery/gallery.qml
+++ b/examples/quickcontrols2/gallery/gallery.qml
@@ -135,6 +135,8 @@ ApplicationWindow {
ListView {
id: listView
+
+ focus: true
currentIndex: -1
anchors.fill: parent
@@ -143,10 +145,8 @@ ApplicationWindow {
text: model.title
highlighted: ListView.isCurrentItem
onClicked: {
- if (listView.currentIndex != index) {
- listView.currentIndex = index
- stackView.push(model.source)
- }
+ listView.currentIndex = index
+ stackView.push(model.source)
drawer.close()
}
}