extensionPrefs: Scroll with key focus

Currently when the extensions list is scrolled, it is possible to
keynav out of view, as the scrolling doesn't follow the key focus.

Hook up the adjustment to fix that.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1968
This commit is contained in:
Florian Müllner 2020-01-30 01:28:02 +01:00
parent 1afd2c6ad2
commit db85e7084c
2 changed files with 6 additions and 2 deletions

View File

@ -70,7 +70,9 @@ var ExtensionsWindow = GObject.registerClass({
InternalChildren: [ InternalChildren: [
'extensionsList', 'extensionsList',
'killSwitch', 'killSwitch',
'mainBox',
'mainStack', 'mainStack',
'scrolledWindow',
], ],
}, class ExtensionsWindow extends Gtk.ApplicationWindow { }, class ExtensionsWindow extends Gtk.ApplicationWindow {
_init(params) { _init(params) {
@ -80,6 +82,8 @@ var ExtensionsWindow = GObject.registerClass({
this._loaded = false; this._loaded = false;
this._prefsDialog = null; this._prefsDialog = null;
this._mainBox.set_focus_vadjustment(this._scrolledWindow.vadjustment);
this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell' }); this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell' });
this._settings.bind('disable-user-extensions', this._settings.bind('disable-user-extensions',
this._killSwitch, 'active', this._killSwitch, 'active',

View File

@ -25,14 +25,14 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="transition_type">crossfade</property> <property name="transition_type">crossfade</property>
<child> <child>
<object class="GtkScrolledWindow"> <object class="GtkScrolledWindow" id="scrolledWindow">
<property name="visible">True</property> <property name="visible">True</property>
<property name="hscrollbar_policy">never</property> <property name="hscrollbar_policy">never</property>
<child> <child>
<object class="GtkViewport"> <object class="GtkViewport">
<property name="visible">True</property> <property name="visible">True</property>
<child> <child>
<object class="GtkBox"> <object class="GtkBox" id="mainBox">
<property name="visible">True</property> <property name="visible">True</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="halign">center</property> <property name="halign">center</property>