[nautilus] location-entry: Set the arrow icon according to locale's text direction



commit 79bb5a6726630fc3cda3b6ab4c3b00b02820e3f5
Author: Yosef Or Boczko <yoseforb src gnome org>
Date:   Sun Feb 16 10:58:05 2014 +0200

    location-entry: Set the arrow icon according to locale's text direction
    
    https://bugzilla.gnome.org/show_bug.cgi?id=719355

 src/nautilus-location-entry.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-location-entry.c b/src/nautilus-location-entry.c
index e10ee8b..7aa8a77 100644
--- a/src/nautilus-location-entry.c
+++ b/src/nautilus-location-entry.c
@@ -655,19 +655,24 @@ void
 nautilus_location_entry_set_secondary_action (NautilusLocationEntry *entry,
                                              NautilusLocationEntryAction secondary_action)
 {
+       gboolean rtl;
+
        if (entry->details->secondary_action == secondary_action) {
                return;
        }
+
+       rtl = gtk_widget_get_direction (GTK_WIDGET (entry)) == GTK_TEXT_DIR_RTL;
+
        switch (secondary_action) {
        case NAUTILUS_LOCATION_ENTRY_ACTION_CLEAR:
                gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry), 
                                                   GTK_ENTRY_ICON_SECONDARY,
-                                                  "edit-clear-symbolic");
+                                                  rtl ? "edit-clear-rtl-symbolic" : "edit-clear-symbolic");
                break;
        case NAUTILUS_LOCATION_ENTRY_ACTION_GOTO:
                gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
                                                   GTK_ENTRY_ICON_SECONDARY,
-                                                  "go-next-symbolic");
+                                                  rtl ? "go-next-rtl-symbolic" : "go-next-symbolic");
                break;
        default:
                g_assert_not_reached ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]