From 1ce2a57f4bbe1cd100905801b7c682b20a786282 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 21 Apr 2012 22:53:47 +0200 Subject: [PATCH] Use go-jump-symbolic for 'Go to' if available Fixes: https://bugs.launchpad.net/midori/+bug/772106 --- midori/midori-browser.c | 10 ++++++++-- midori/midori-locationaction.c | 18 +++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 0697a7ff..f0852082 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -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 diff --git a/midori/midori-locationaction.c b/midori/midori-locationaction.c index 3d1a1a41..c49f64a7 100644 --- a/midori/midori-locationaction.c +++ b/midori/midori-locationaction.c @@ -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 } -- 2.39.5