GNOME Bugzilla – Bug 622243
[panel] Flip left and right group in RTL locales
Last modified: 2010-06-22 19:02:20 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.
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 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.
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 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.)
(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