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 643156 - StScrollView adjustments for RTL locales
StScrollView adjustments for 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: 2011-02-24 01:57 UTC by Florian Müllner
Modified: 2011-02-24 12:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
scroll-view: Make scrollbar position locale aware (2.82 KB, patch)
2011-02-24 01:57 UTC, Florian Müllner
committed Details | Review
scroll-view-fade: Adjust the effect to work in RTL locales (3.53 KB, patch)
2011-02-24 01:57 UTC, Florian Müllner
needs-work Details | Review
scroll-view-fade: Adjust the effect to work in RTL locales (3.30 KB, patch)
2011-02-24 11:40 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2011-02-24 01:57:10 UTC
See patches.
Comment 1 Florian Müllner 2011-02-24 01:57:13 UTC
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.
Comment 2 Florian Müllner 2011-02-24 01:57:23 UTC
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.
Comment 3 drago01 2011-02-24 09:53:54 UTC
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))
Comment 4 drago01 2011-02-24 09:58:00 UTC
Review of attachment 181784 [details] [review]:

Looks good.
Comment 5 Florian Müllner 2011-02-24 11:40:58 UTC
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.
Comment 6 drago01 2011-02-24 11:53:02 UTC
Review of attachment 181819 [details] [review]:

Looks good.
Comment 7 Florian Müllner 2011-02-24 12:04:15 UTC
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