dash/dashIcon: Popup menu above the icon
Now that the Dash is horizontal, the popup menu of the Dash icons must show up, instead of left/right. Make AppIcon.popupMenu() receive an optional parameter with the side to show the menu, using St.Side.LEFT as default. Override this method in DashIcon to always pass St.Side.TOP. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1559>
This commit is contained in:
parent
0a23721364
commit
1e2532cf25
@ -2756,7 +2756,7 @@ var AppIcon = GObject.registerClass({
|
||||
return this.app.get_id();
|
||||
}
|
||||
|
||||
popupMenu() {
|
||||
popupMenu(side = St.Side.LEFT) {
|
||||
this._removeMenuTimeout();
|
||||
this.fake_release();
|
||||
|
||||
@ -2764,7 +2764,7 @@ var AppIcon = GObject.registerClass({
|
||||
this._draggable.fakeRelease();
|
||||
|
||||
if (!this._menu) {
|
||||
this._menu = new AppIconMenu(this);
|
||||
this._menu = new AppIconMenu(this, side);
|
||||
this._menu.connect('activate-window', (menu, window) => {
|
||||
this.activateWindow(window);
|
||||
});
|
||||
@ -2920,10 +2920,13 @@ var AppIcon = GObject.registerClass({
|
||||
});
|
||||
|
||||
var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {
|
||||
constructor(source) {
|
||||
let side = St.Side.LEFT;
|
||||
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
|
||||
constructor(source, side) {
|
||||
if (Clutter.get_default_text_direction() === Clutter.TextDirection.RTL) {
|
||||
if (side === St.Side.LEFT)
|
||||
side = St.Side.RIGHT;
|
||||
else if (side === St.Side.RIGHT)
|
||||
side = St.Side.LEFT;
|
||||
}
|
||||
|
||||
super(source, 0.5, side);
|
||||
|
||||
|
@ -31,6 +31,10 @@ class DashIcon extends AppDisplay.AppIcon {
|
||||
});
|
||||
}
|
||||
|
||||
popupMenu() {
|
||||
super.popupMenu(St.Side.BOTTOM);
|
||||
}
|
||||
|
||||
// Disable scale-n-fade methods used during DND by parent
|
||||
scaleAndFade() {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user