GNOME Bugzilla – Bug 604421
RTL text aligned wrong within GtkTreeView label with ellipsization on
Last modified: 2018-02-10 03:35:34 UTC
Created attachment 149622 [details] screenshot See the regions outlined in red in the screenshot. The RTL text is far away from the icon. More discussion in http://code.google.com/p/chromium/issues/detail?id=30167
I played a bit with arabic strings in testtreeview with the UI in LTR and RTL mode, and the behavior seems just fine. The arabic text is not wrongly aligned as in the left window in the screenshot. Are you perhaps setting the alignment yourself on GtkCellRendererText for RTL language strings?
I looked through the code behind the original screenshot and didn't find any explicit alignment, but it's possible I missed something; the problem also occurs in the normal GtkFileChooser so it seems more likely it's a default somewhere. Here are some screenshots from a GtkFileChooser in gedit. Note how in LTR, the rows in different directionalities is far away from each other, but how in RTL, the text in the rows is adjacent.
Created attachment 149642 [details] file chooser in english
Created attachment 149643 [details] file chooser in arabic
Aaah, found it now. It is being caused by the ellipsization property that's turned on in the file chooser (and I guess in the Chromium dialog as well). testtreeview did not test for this. IIRC ellipsization mode tries to allocate as much space as possible for the string and in LTR mode the strings are left aligned by default -- which is right aligned for the RTL string. I think that's why the string is right aligned here. I am wondering whether this alignment inversion should be turned off in case the UI is still in LTR locale/mode.
We're moving to gitlab! As part of this move, we are closing bugs that haven't seen activity in more than 5 years. If this issue is still imporant to you and still relevant with GTK+ 3.22 or master, please consider creating a gitlab issue for it.