dash: Fix 'All apps' button position in RTL locales
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1559>
This commit is contained in:
parent
97eb4560ef
commit
0a23721364
@ -295,16 +295,27 @@ class DashActor extends St.Widget {
|
|||||||
|
|
||||||
let [appIcons, showAppsButton] = this.get_children();
|
let [appIcons, showAppsButton] = this.get_children();
|
||||||
const [, showAppsNatWidth] = showAppsButton.get_preferred_width(availHeight);
|
const [, showAppsNatWidth] = showAppsButton.get_preferred_width(availHeight);
|
||||||
|
const rtl = this.text_direction === Clutter.TextDirection.RTL;
|
||||||
|
|
||||||
let childBox = new Clutter.ActorBox();
|
let childBox = new Clutter.ActorBox();
|
||||||
childBox.x1 = contentBox.x1;
|
|
||||||
childBox.y1 = contentBox.y1;
|
childBox.y1 = contentBox.y1;
|
||||||
childBox.x2 = contentBox.x2 - showAppsNatWidth;
|
|
||||||
childBox.y2 = contentBox.y2;
|
childBox.y2 = contentBox.y2;
|
||||||
|
if (rtl) {
|
||||||
|
childBox.x1 = contentBox.x1 + showAppsNatWidth;
|
||||||
|
childBox.x2 = contentBox.x2;
|
||||||
|
} else {
|
||||||
|
childBox.x1 = contentBox.x1;
|
||||||
|
childBox.x2 = contentBox.x2 - showAppsNatWidth;
|
||||||
|
}
|
||||||
appIcons.allocate(childBox);
|
appIcons.allocate(childBox);
|
||||||
|
|
||||||
childBox.x1 = contentBox.x2 - showAppsNatWidth;
|
if (rtl) {
|
||||||
childBox.x2 = contentBox.x2;
|
childBox.x1 = contentBox.x1;
|
||||||
|
childBox.x2 = contentBox.x1 + showAppsNatWidth;
|
||||||
|
} else {
|
||||||
|
childBox.x1 = contentBox.x2 - showAppsNatWidth;
|
||||||
|
childBox.x2 = contentBox.x2;
|
||||||
|
}
|
||||||
showAppsButton.allocate(childBox);
|
showAppsButton.allocate(childBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user