searchDisplay, viewSelector: use St keynav in Applications and Search
https://bugzilla.gnome.org/show_bug.cgi?id=663901
This commit is contained in:
@ -151,6 +151,23 @@ const SearchTab = new Lang.Class({
|
||||
global.stage.connect('notify::key-focus', Lang.bind(this, this._updateCursorVisibility));
|
||||
|
||||
this._capturedEventId = 0;
|
||||
|
||||
// Since the entry isn't inside the results container we install this
|
||||
// dummy widget as the last results container child so that we can
|
||||
// include the entry in the keynav tab path...
|
||||
this._focusTrap = new St.Bin({ can_focus: true });
|
||||
this._focusTrap.connect('key-focus-in', Lang.bind(this, function() {
|
||||
this._entry.grab_key_focus();
|
||||
}));
|
||||
// ... but make it unfocusable using arrow keys keynav by making its
|
||||
// bounding box always contain the possible focus source's bounding
|
||||
// box since StWidget's keynav logic won't ever select it as a target
|
||||
// in that case.
|
||||
this._focusTrap.add_constraint(new Clutter.BindConstraint({ source: this._searchResults.actor,
|
||||
coordinate: Clutter.BindCoordinate.ALL }));
|
||||
this._searchResults.actor.add_actor(this._focusTrap);
|
||||
|
||||
global.focus_manager.add_group(this._searchResults.actor);
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
@ -271,8 +288,17 @@ const SearchTab = new Lang.Class({
|
||||
this._reset();
|
||||
return true;
|
||||
}
|
||||
} else if (this.active) {
|
||||
if (symbol == Clutter.Tab) {
|
||||
this._searchResults.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
|
||||
return true;
|
||||
} else if (symbol == Clutter.ISO_Left_Tab) {
|
||||
this._focusTrap.can_focus = false;
|
||||
this._searchResults.actor.navigate_focus(null, Gtk.DirectionType.TAB_BACKWARD, false);
|
||||
this._focusTrap.can_focus = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
@ -517,18 +543,25 @@ const ViewSelector = new Lang.Class({
|
||||
if (symbol == Clutter.Escape) {
|
||||
Main.overview.hide();
|
||||
return true;
|
||||
} else if (modifiers & Clutter.ModifierType.CONTROL_MASK) {
|
||||
if (symbol == Clutter.Page_Up) {
|
||||
if (!this._searchTab.active)
|
||||
} else if (Clutter.keysym_to_unicode(symbol) ||
|
||||
(symbol == Clutter.BackSpace && this._searchTab.active)) {
|
||||
this._searchTab.startSearch(event);
|
||||
} else if (!this._searchTab.active) {
|
||||
if (modifiers & Clutter.ModifierType.CONTROL_MASK) {
|
||||
if (symbol == Clutter.Page_Up) {
|
||||
this._prevTab();
|
||||
return true;
|
||||
} else if (symbol == Clutter.Page_Down) {
|
||||
if (!this._searchTab.active)
|
||||
return true;
|
||||
} else if (symbol == Clutter.Page_Down) {
|
||||
this._nextTab();
|
||||
return true;
|
||||
}
|
||||
} else if (symbol == Clutter.Tab) {
|
||||
this._activeTab.page.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
|
||||
return true;
|
||||
} else if (symbol == Clutter.ISO_Left_Tab) {
|
||||
this._activeTab.page.navigate_focus(null, Gtk.DirectionType.TAB_BACKWARD, false);
|
||||
return true;
|
||||
}
|
||||
} else if (Clutter.keysym_to_unicode(symbol)) {
|
||||
this._searchTab.startSearch(event);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
Reference in New Issue
Block a user