]> spindle.queued.net Git - midori/commitdiff
Use a Go icon when showing the target URI in the location
authorChristian Dywan <christian@twotoasts.de>
Fri, 24 Jul 2009 15:01:02 +0000 (17:01 +0200)
committerChristian Dywan <christian@twotoasts.de>
Fri, 24 Jul 2009 15:01:02 +0000 (17:01 +0200)
midori/midori-browser.c
midori/midori-locationaction.c

index 7dbc89145362b25b159833089fc23393c43d2f9b..af7b4013fa2cadd29541b6f8ba547f2283a32b00 100644 (file)
@@ -352,12 +352,8 @@ _midori_browser_set_statusbar_text (MidoriBrowser* browser,
         MidoriLocationAction* location_action = MIDORI_LOCATION_ACTION (action);
         if (text && *text)
         {
-            static GdkPixbuf* blank = NULL;
-            if (G_UNLIKELY (!blank))
-                blank = gdk_pixbuf_new_from_data ((guchar*)"",
-                    GDK_COLORSPACE_RGB, TRUE, 8, 1, 1, 1, NULL, NULL);
             midori_location_action_set_uri (location_action, text);
-            midori_location_action_set_icon (location_action, blank);
+            midori_location_action_set_icon (location_action, NULL);
             midori_location_action_set_secondary_icon (location_action, NULL);
         }
         else
index 3d630fd130037be4a0b7171a01b9acdc735fdcf4..dcae3f649fae6b014cd7bb9d5f8421bf9378c8af 100644 (file)
@@ -1119,6 +1119,16 @@ midori_location_action_set_uri (MidoriLocationAction* location_action,
     midori_location_action_set_text (location_action, uri);
 }
 
+/**
+ * midori_location_action_set_icon:
+ * @location_action: a #MidoriLocationAction
+ * @icon: a #GdkPixbuf or %NULL
+ *
+ * Sets the icon shown on the left hand side.
+ *
+ * Note: Since 0.1.8 %NULL can be passed to indicate that the
+ *     visible URI refers to a target, not the current location.
+ **/
 void
 midori_location_action_set_icon (MidoriLocationAction* location_action,
                                  GdkPixbuf*            icon)
@@ -1128,7 +1138,7 @@ midori_location_action_set_icon (MidoriLocationAction* location_action,
     GtkWidget* entry;
 
     g_return_if_fail (MIDORI_IS_LOCATION_ACTION (location_action));
-    g_return_if_fail (GDK_IS_PIXBUF (icon));
+    g_return_if_fail (!icon || GDK_IS_PIXBUF (icon));
 
     proxies = gtk_action_get_proxies (GTK_ACTION (location_action));
 
@@ -1138,8 +1148,12 @@ midori_location_action_set_icon (MidoriLocationAction* location_action,
         location_entry = midori_location_action_entry_for_proxy (proxies->data);
         entry = gtk_bin_get_child (GTK_BIN (location_entry));
 
-        gtk_icon_entry_set_icon_from_pixbuf (GTK_ICON_ENTRY (entry),
-            GTK_ICON_ENTRY_PRIMARY, icon);
+        if (icon)
+            gtk_icon_entry_set_icon_from_pixbuf (GTK_ICON_ENTRY (entry),
+                GTK_ICON_ENTRY_PRIMARY, icon);
+        else
+            gtk_icon_entry_set_icon_from_stock (GTK_ICON_ENTRY (entry),
+                GTK_ICON_ENTRY_PRIMARY, GTK_STOCK_JUMP_TO);
     }
 }