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 702408 - Broken RTL handling for back button icon
Broken RTL handling for back button icon
Status: RESOLVED FIXED
Product: baobab
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Baobab Maintainers
Baobab Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-06-16 18:22 UTC by Yosef Or Boczko
Modified: 2013-06-22 18:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Set button arrow icons according to locale's text direction (878 bytes, patch)
2013-06-16 18:23 UTC, Yosef Or Boczko
needs-work Details | Review
Set button arrow icons according to locale's text direction (1.54 KB, patch)
2013-06-16 20:13 UTC, Yosef Or Boczko
needs-work Details | Review
Set button arrow icons according to locale's text direction (999 bytes, patch)
2013-06-17 15:58 UTC, Yosef Or Boczko
committed Details | Review
Part of previous commit forgotten (783 bytes, patch)
2013-06-17 21:22 UTC, Yosef Or Boczko
committed Details | Review

Description Yosef Or Boczko 2013-06-16 18:22:43 UTC
See patch.

Pleas push the patch also to branch gnome-3-8.
Comment 1 Yosef Or Boczko 2013-06-16 18:23:14 UTC
Created attachment 246976 [details] [review]
Set button arrow icons according to locale's text direction
Comment 2 Stefano Facchini 2013-06-16 19:36:44 UTC
Review of attachment 246976 [details] [review]:

::: src/baobab-window.vala
@@ +186,3 @@
             set_ui_state (home_page, false);
 
+            if(Gtk.Widget.get_default_direction() == Gtk.TextDirection.RTL)

Here you should just use get_direction () == Gtk.TextDirection.RTL, right? And put a space before open parentheses, after "if" and after "get_default_direction" and all the others.

@@ +187,3 @@
 
+            if(Gtk.Widget.get_default_direction() == Gtk.TextDirection.RTL)
+            {

In our coding style the open curly brace is on the same row of the "if" statement

@@ +189,3 @@
+            {
+                Gtk.Image back_button_image = back_button.get_child() as Gtk.Image;
+                back_button_image.set_from_icon_name("go-previous-rtl-symbolic", Gtk.IconSize.MENU);

Use the property assignment instead of the setter, i.e. just do

button_image.icon_name = "go-previous-rtl-symbolic".

Since we cannot use the .UI file to automatically set the image here, I think it would be clearer to have
if (get_direction () == Gtk.TextDirection.LTR) {
  image.icon_name = "go-previous-symbolic";
} else {
  image.icon_name = "go-previous-rtl-symbolic";
}

and remove the icon_name property in the .UI

Also, maybe move the code near the top of the constructor, like after setup_treview() or so.
Comment 3 Paolo Borelli 2013-06-16 19:51:04 UTC
I guess we also need to change the direction of the animations
Comment 4 Yosef Or Boczko 2013-06-16 20:13:05 UTC
Created attachment 246980 [details] [review]
Set button arrow icons according to locale's text direction
Comment 5 Stefano Facchini 2013-06-17 11:59:19 UTC
Review of attachment 246980 [details] [review]:

Better, now replace "Gtk.Image" with "var" in type definition and you're done!

As for changing animation direction, I think here we need different patches for master and the gnome-3.8 branch. Yosef could you take care of this, too?
Comment 6 Stefano Facchini 2013-06-17 12:05:12 UTC
(In reply to comment #5)
> As for changing animation direction, I think here we need different patches for
> master and the gnome-3.8 branch. Yosef could you take care of this, too?

Actually, it seems that master does already the right thing, so we only need a fix for gnome-3.8
Comment 7 Yosef Or Boczko 2013-06-17 15:58:28 UTC
Created attachment 247047 [details] [review]
Set button arrow icons according to locale's text direction
Comment 8 Stefano Facchini 2013-06-17 21:06:25 UTC
Comment on attachment 247047 [details] [review]
Set button arrow icons according to locale's text direction

Attachment 247047 [details] pushed as eb58d8c - Set button arrow icons according to locale's text direction
Comment 9 Yosef Or Boczko 2013-06-17 21:22:30 UTC
Created attachment 247074 [details] [review]
Part of previous commit forgotten