~unity-2d-team/unity-2d/trunk

« back to all changes in this revision

Viewing changes to shell/dash/Dash.qml

  • Committer: Tarmac
  • Author(s): Albert Astals
  • Date: 2012-04-16 14:30:20 UTC
  • mfrom: (1043.2.18 dash_tab_handling)
  • Revision ID: tarmac-20120416143020-aqkxea26w9hj29ye
[Dash] Handle Tab and Shift+Tab to navigate between the headers. Fixes: https://bugs.launchpad.net/bugs/891565, https://bugs.launchpad.net/bugs/891648. Approved by Gerry Boland.

Show diffs side-by-side

added added

removed removed

Lines of Context:
266
266
                       (event.key == Qt.Key_PageUp && event.modifiers == Qt.ControlModifier)) {
267
267
                changeLens(-1);
268
268
                event.accepted = true
 
269
            } else if (event.key == Qt.Key_Tab && event.modifiers == Qt.NoModifier) {
 
270
                if (search_entry.activeFocus || lensBar.activeFocus || filterPane.activeFocus) {
 
271
                    if (!pageLoader.item.isListEmpty()) {
 
272
                        pageLoader.item.focusFirstHeader()
 
273
                    } else if (filterPane.visible) {
 
274
                        filterPane.focusFirstHeader()
 
275
                    }
 
276
                } else if (pageLoader.activeFocus) {
 
277
                    if (filterPane.visible) {
 
278
                        filterPane.focusFirstHeader()
 
279
                    } else if (!pageLoader.item.isListEmpty()) {
 
280
                        pageLoader.item.focusFirstHeader()
 
281
                    }
 
282
                } else {
 
283
                    console.log("Dash: Tab pressed with focus in unexpected item")
 
284
                }
 
285
                event.accepted = true
 
286
            } else if (event.key == Qt.Key_Backtab && event.modifiers == Qt.ShiftModifier) {
 
287
                if (filterPane.activeFocus) {
 
288
                    if (!pageLoader.item.isListEmpty()) {
 
289
                        pageLoader.item.focusLastHeader()
 
290
                    }
 
291
                } else if (search_entry.activeFocus || lensBar.activeFocus || pageLoader.activeFocus) {
 
292
                    if (filterPane.visible) {
 
293
                        filterPane.focusLastHeader()
 
294
                    } else if (!pageLoader.item.isListEmpty()) {
 
295
                        pageLoader.item.focusLastHeader()
 
296
                    }
 
297
                } else {
 
298
                    console.log("Dash: Tab pressed with focus in unexpected item")
 
299
                }
 
300
                event.accepted = true
269
301
            }
270
302
        }
271
303