GNOME Bugzilla – Bug 643156
StScrollView adjustments for RTL locales
Last modified: 2011-02-24 12:04:21 UTC
See patches.
Created attachment 181784 [details] [review] scroll-view: Make scrollbar position locale aware In RTL locales, the vertical scrollbar should be located on the left, so take the widget's text direction into account when allocating the view's elements.
Created attachment 181785 [details] [review] scroll-view-fade: Adjust the effect to work in RTL locales The vertical scrollbar is located on the left in RTL locales, so pass an additional offset parameter to the shader and set it to the horizontal offset depending on the locale's text direction.
Review of attachment 181785 [details] [review]: ::: src/st/st-scroll-view-fade.c @@ +53,3 @@ " float fade_bottom_start = height - offset_bottom;\n" " \n" +" if (offset_top != 0.0 && y < offset_top && x > offset_x && x < (width - scrollbar_width)) {\n" That doesn't look right to me, you are constraining the faded area at both sides for RTL locales (i.e we don't want the "x < (width - scrollbar_width)" check for RTL locales). A better approach would be to have a boolean uniform and do something like ((x > scrollbar_width && rtl) || (x < (width - scrollbar_width) && !rtl))
Review of attachment 181784 [details] [review]: Looks good.
Created attachment 181819 [details] [review] scroll-view-fade: Adjust the effect to work in RTL locales (In reply to comment #3) > +" if (offset_top != 0.0 && y < offset_top && x > offset_x && x < (width - > scrollbar_width)) {\n" > > That doesn't look right to me, you are constraining the faded area at both > sides for RTL locales (i.e we don't want the "x < (width - scrollbar_width)" > check for RTL locales). Yeah, I originally meant to change width from "width of the actor" to "width of the faded area" ... when that didn't work out I forgot to add it (e.g. "x < (offset_x + width - scrollbar_width)"). > A better approach would be to have a boolean uniform and do something like > ((x > scrollbar_width && rtl) || (x < (width - scrollbar_width) && !rtl)) OK.
Review of attachment 181819 [details] [review]: Looks good.
Attachment 181784 [details] pushed as d15122c - scroll-view: Make scrollbar position locale aware Attachment 181819 [details] pushed as 63be52e - scroll-view-fade: Adjust the effect to work in RTL locales