apps-menu: Scroll application into view when active
When an ApplicationMenuItem becomes active, scroll the application scroll box so that it becomes visible. This stopped working when the gnome-shell API changed from getActive()/setActive() to the active GObject property. Closes https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/562 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/391>
This commit is contained in:
@@ -65,6 +65,8 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem {
|
||||
return maybeStartDrag.call(draggable, event);
|
||||
return false;
|
||||
};
|
||||
|
||||
this.connect('notify::active', this._onActiveChanged.bind(this));
|
||||
}
|
||||
|
||||
activate(event) {
|
||||
@@ -76,10 +78,11 @@ class ApplicationMenuItem extends PopupMenu.PopupBaseMenuItem {
|
||||
Main.overview.hide();
|
||||
}
|
||||
|
||||
setActive(active, params) {
|
||||
if (active)
|
||||
this._button.scrollToButton(this);
|
||||
super.setActive(active, params);
|
||||
_onActiveChanged() {
|
||||
if (!this.active)
|
||||
return;
|
||||
|
||||
this._button.scrollToButton(this);
|
||||
}
|
||||
|
||||
setDragEnabled(enabled) {
|
||||
|
||||
Reference in New Issue
Block a user