[gnome-shell] dash: Fix 'All apps' button position in RTL locales
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] dash: Fix 'All apps' button position in RTL locales
- Date: Tue, 19 Jan 2021 14:04:54 +0000 (UTC)
commit 0a2372136437b093b59a5ce120c38a80c8d7a83f
Author: Abderrahim Kitouni <akitouni gnome org>
Date: Sat Jan 16 18:45:07 2021 +0100
dash: Fix 'All apps' button position in RTL locales
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1559>
js/ui/dash.js | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index a4dc7a8fb5..3d6e756232 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -295,16 +295,27 @@ class DashActor extends St.Widget {
let [appIcons, showAppsButton] = this.get_children();
const [, showAppsNatWidth] = showAppsButton.get_preferred_width(availHeight);
+ const rtl = this.text_direction === Clutter.TextDirection.RTL;
let childBox = new Clutter.ActorBox();
- childBox.x1 = contentBox.x1;
childBox.y1 = contentBox.y1;
- childBox.x2 = contentBox.x2 - showAppsNatWidth;
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);
- childBox.x1 = contentBox.x2 - showAppsNatWidth;
- childBox.x2 = contentBox.x2;
+ if (rtl) {
+ childBox.x1 = contentBox.x1;
+ childBox.x2 = contentBox.x1 + showAppsNatWidth;
+ } else {
+ childBox.x1 = contentBox.x2 - showAppsNatWidth;
+ childBox.x2 = contentBox.x2;
+ }
showAppsButton.allocate(childBox);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]