Commit 1e2532cf authored by Georges Basile Stavracas Neto's avatar Georges Basile Stavracas Neto Committed by Marge Bot

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: <!1559>
parent 0a237213
......@@ -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)
side = St.Side.RIGHT;
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() {
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment