From 356f3f20bedb073cff21c922843b010454c940c8 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Fri, 24 Jul 2009 17:01:02 +0200 Subject: [PATCH] Use a Go icon when showing the target URI in the location --- midori/midori-browser.c | 6 +----- midori/midori-locationaction.c | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 7dbc8914..af7b4013 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -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 diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 3d630fd1..dcae3f64 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -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); } } -- 2.39.5