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 622243 - [panel] Flip left and right group in RTL locales
[panel] Flip left and right group in RTL locales
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-06-20 22:26 UTC by Florian Müllner
Modified: 2010-06-22 19:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[panel] Flip left and right group in RTL locales (2.54 KB, patch)
2010-06-20 22:26 UTC, Florian Müllner
reviewed Details | Review
[panel] Flip left and right group in RTL locales (4.84 KB, patch)
2010-06-21 16:26 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2010-06-20 22:26:44 UTC
See patch. This should improve the panel significantly in RTL locales. Outstanding issues are the button styles (rounded corners at the wrong side) and the ripple.
Comment 1 Florian Müllner 2010-06-20 22:26:49 UTC
Created attachment 164179 [details] [review]
[panel] Flip left and right group in RTL locales

While the contents of the left and right group in the panel are
flipped correctly, the groups themselves have to be swapped as
well. The location of the hot corner has to be corrected as well.
Comment 2 Dan Winship 2010-06-21 14:07:53 UTC
Comment on attachment 164179 [details] [review]
[panel] Flip left and right group in RTL locales

>+                this._hotCornerEnvirons.x = leftWidth - this._hotCornerEnvirons.width;
>+                this._hotCorner.x = leftWidth - this._hotCorner.width;

It's a bit odd that we have to move the hotCorner every time. Could we make hotCorner and hotCornerEnvirons children of this._boxContainer rather than children of this._leftBox?

>+                childBox.x1 = 0;
>+                childBox.x2 = childBox.x1 + Math.floor(sideWidth);

I know this part is just copied from the existing code, but it seems silly to add childBox.x1 to the width in the second line given that you know for a fact that it's 0.

>+            if (this.actor.get_direction() == St.TextDirection.RTL) {
>+                childBox.x1 = 0;
>+                childBox.x2 = Math.min(Math.floor(sideWidth),
>+                                       rightNaturalWidth);

Please make the leftbox and rightbox allocation code more consistent; for leftbox you're always allocating it the available width when it's on the left, and allocating it the minimum of the available and natural widths (via a temporary variable) when it's on the right. For rightbox, you're allocating it the minimum of available/natural (but not via a temporary variable) whether it's on the left or the right.
Comment 3 Florian Müllner 2010-06-21 16:26:03 UTC
Created attachment 164230 [details] [review]
[panel] Flip left and right group in RTL locales

While the contents of the left and right group in the panel are
flipped correctly, the groups themselves have to be swapped as
well. The location of the hot corner has to be corrected as well.
Comment 4 Dan Winship 2010-06-22 18:48:11 UTC
Comment on attachment 164230 [details] [review]
[panel] Flip left and right group in RTL locales

oh, hm, i was thinking keeping the hotcorner/environs still fixed-position, but fixed-position within the boxcontainer. But I was assuming that the panel knew its own width, which it doesn't really... it gets set by main.js.

At any rate, if we're adjusting its location from within allocate, we need to use allocatino rather than fixed positioning anyway, so this patch is right. (The previous one ought to cause one of those queue-allocation warnings.)
Comment 5 Florian Müllner 2010-06-22 19:02:14 UTC
(In reply to comment #4)
> (From update of attachment 164230 [details] [review])
> oh, hm, i was thinking keeping the hotcorner/environs still fixed-position, but
> fixed-position within the boxcontainer. But I was assuming that the panel knew
> its own width, which it doesn't really... it gets set by main.js.

hm, despite its name, boxcontainer is a generic container - do those even support fixed-position?


Attachment 164230 [details] pushed as 81aed78 - [panel] Flip left and right group in RTL locales