After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 645524 - Shell menus (user menu for example) has wrong alignment in RTL locales.
Shell menus (user menu for example) has wrong alignment in RTL locales.
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
2.91.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-03-22 14:05 UTC by Elad Alfassa
Modified: 2011-03-22 17:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot of the wrong alignment (418.12 KB, image/png)
2011-03-22 14:05 UTC, Elad Alfassa
  Details
PopupMenu: invert the menu when in RTL locales (6.54 KB, patch)
2011-03-22 16:59 UTC, Giovanni Campagna
reviewed Details | Review
PopupMenu: invert the menu when in RTL locales (5.79 KB, patch)
2011-03-22 17:21 UTC, Giovanni Campagna
committed Details | Review

Description Elad Alfassa 2011-03-22 14:05:06 UTC
Created attachment 184061 [details]
Screenshot of the wrong alignment

Shell menus, including User Menu, Bluetooth, accessibility, volume control, etc. are aligned to the left, although in RTL locales, the text should be aligned to the right.

Screenshot attached. 

Should be easy to fix, text-align: right; in the right place on the CSS file will fix this.
Comment 1 Dan Winship 2011-03-22 16:03:31 UTC
actually, presumably the whole layout should be flipped
Comment 2 Giovanni Campagna 2011-03-22 16:59:48 UTC
Created attachment 184099 [details] [review]
PopupMenu: invert the menu when in RTL locales

Change the way menu items allocate their contents to take text
direction into account, so they're fully reversed in RTL locales,
and St.Align.START / END are respected.
Comment 3 Dan Winship 2011-03-22 17:17:51 UTC
Comment on attachment 184099 [details] [review]
PopupMenu: invert the menu when in RTL locales

>+    /* This returns column widths in logical order (i.e. from the dot
>+       to the image), not in visual order (left to right) */

//-style comments

>+                } else if (child.align === St.Align.CENTER) {
>+                    childBox.x1 = x - Math.round(extraWidth / 2);
>+                    childBox.x2 = childBox.x1 - naturalWidth;

x1 and x2 are reversed here (the RTL case)

>diff --git a/src/shell-global.c b/src/shell-global.c

That shouldn't have ended up in this patch...


It seems pretty clear that this doesn't change the LTR behavior at all, and (with the above fix), all the RTL stuff looks right too. And even if it's wrong, it's probably still better than how it is now... so I think we should commit this. (Not sure how frozen we are. Talk to Owen on IRC.)
Comment 4 Giovanni Campagna 2011-03-22 17:21:54 UTC
Created attachment 184101 [details] [review]
PopupMenu: invert the menu when in RTL locales

Change the way menu items allocate their contents to take text
direction into account, so they're fully reversed in RTL locales,
and St.Align.START / END are respected.
Comment 5 Giovanni Campagna 2011-03-22 17:27:22 UTC
Attachment 184101 [details] pushed as cbd1873 - PopupMenu: invert the menu when in RTL locales