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:
Victor Kareh
2025-03-13 18:01:08 -04:00
parent 3b4e241b26
commit f4e044b4fe

View File

@@ -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) {