]> spindle.queued.net Git - midori/commitdiff
Use go-jump-symbolic for 'Go to' if available
authorChristian Dywan <christian@twotoasts.de>
Sat, 21 Apr 2012 20:53:47 +0000 (22:53 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sat, 21 Apr 2012 20:55:37 +0000 (22:55 +0200)
Fixes: https://bugs.launchpad.net/midori/+bug/772106
midori/midori-browser.c
midori/midori-locationaction.c

index 0697a7ff87ca0fe62261c49c3d8bc1566e2cc2b1..f0852082f05e60de7c6d7ac05671839d4cc60fec 100644 (file)
@@ -3690,8 +3690,14 @@ static void
 _action_location_focus_in (GtkAction*     action,
                            MidoriBrowser* browser)
 {
-    midori_location_action_set_secondary_icon (
-        MIDORI_LOCATION_ACTION (action), GTK_STOCK_JUMP_TO);
+    GdkScreen* screen = gtk_widget_get_screen (browser->notebook);
+    GtkIconTheme* icon_theme = gtk_icon_theme_get_for_screen (screen);
+    if (gtk_icon_theme_has_icon (icon_theme, "go-jump-symbolic"))
+        midori_location_action_set_secondary_icon (
+            MIDORI_LOCATION_ACTION (action), "go-jump-symbolic");
+    else
+        midori_location_action_set_secondary_icon (
+            MIDORI_LOCATION_ACTION (action), GTK_STOCK_JUMP_TO);
 }
 
 static void
index 3d1a1a41c2b1a5e72851c5ec4053fde967cf78b6..c49f64a767184d97f81e814b8d9f2d3fbb6e5858 100644 (file)
@@ -1649,6 +1649,15 @@ midori_location_action_set_progress (MidoriLocationAction* location_action,
     }
 }
 
+/**
+ * midori_location_action_set_security_hint:
+ * @location_action: a #MidoriLocationAction
+ * @icon: a stock ID, or an icon name
+ *
+ * Sets the secondary, ie right hand side icon.
+ *
+ * Since 0.4.6 @icon can be a stock ID or an icon name.
+ **/
 void
 midori_location_action_set_secondary_icon (MidoriLocationAction* location_action,
                                            const gchar*          stock_id)
@@ -1659,7 +1668,6 @@ midori_location_action_set_secondary_icon (MidoriLocationAction* location_action
     GtkStockItem stock_item;
 
     g_return_if_fail (MIDORI_IS_LOCATION_ACTION (location_action));
-    g_return_if_fail (!stock_id || gtk_stock_lookup (stock_id, &stock_item));
 
     katze_assign (location_action->secondary_icon, g_strdup (stock_id));
 
@@ -1670,8 +1678,12 @@ midori_location_action_set_secondary_icon (MidoriLocationAction* location_action
     if (GTK_IS_TOOL_ITEM (proxies->data))
     {
         GtkWidget* entry = midori_location_action_entry_for_proxy (proxies->data);
-        gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry),
-            GTK_ICON_ENTRY_SECONDARY, stock_id);
+        if (stock_id && gtk_stock_lookup (stock_id, &stock_item))
+            gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry),
+                GTK_ICON_ENTRY_SECONDARY, stock_id);
+        else
+            gtk_icon_entry_set_icon_from_icon_name (GTK_ICON_ENTRY (entry),
+                GTK_ICON_ENTRY_SECONDARY, stock_id);
     }
     #endif
 }