From e29af0b6340c0630329ff86b3613171b9d89a5d5 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 21 Apr 2012 22:38:26 +0200 Subject: [PATCH] Only show 'go to' in location to indicate focus Fixes: https://bugs.launchpad.net/midori/+bug/699965 --- midori/midori-browser.c | 48 +++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 996b88e2..0697a7ff 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -284,6 +284,25 @@ _midori_browser_update_actions (MidoriBrowser* browser) } } +static void +midori_browser_update_secondary_icon (MidoriBrowser* browser, + MidoriView* view, + GtkAction* action) +{ + if (g_object_get_data (G_OBJECT (view), "news-feeds")) + { + midori_location_action_set_secondary_icon ( + MIDORI_LOCATION_ACTION (action), STOCK_NEWS_FEED); + _action_set_sensitive (browser, "AddNewsFeed", TRUE); + } + else + { + midori_location_action_set_secondary_icon ( + MIDORI_LOCATION_ACTION (action), NULL); + _action_set_sensitive (browser, "AddNewsFeed", FALSE); + } +} + static void _midori_browser_update_interface (MidoriBrowser* browser) { @@ -350,20 +369,9 @@ _midori_browser_update_interface (MidoriBrowser* browser) #endif action = _action_by_name (browser, "Location"); - if (g_object_get_data (G_OBJECT (view), "news-feeds")) - { - midori_location_action_set_secondary_icon ( - MIDORI_LOCATION_ACTION (action), STOCK_NEWS_FEED); - _action_set_sensitive (browser, "AddNewsFeed", TRUE); - } - else - { - midori_location_action_set_secondary_icon ( - MIDORI_LOCATION_ACTION (action), GTK_STOCK_JUMP_TO); - _action_set_sensitive (browser, "AddNewsFeed", FALSE); - } midori_location_action_set_security_hint ( MIDORI_LOCATION_ACTION (action), midori_view_get_security (view)); + midori_browser_update_secondary_icon (browser, MIDORI_VIEW (view), action); } static void @@ -402,12 +410,7 @@ _midori_browser_set_statusbar_text (MidoriBrowser* browser, #else GtkAction* action = _action_by_name (browser, "Location"); MidoriLocationAction* location_action = MIDORI_LOCATION_ACTION (action); - if (g_object_get_data (G_OBJECT (view), "news-feeds")) - midori_location_action_set_secondary_icon ( - location_action, STOCK_NEWS_FEED); - else - midori_location_action_set_secondary_icon ( - location_action, GTK_STOCK_JUMP_TO); + midori_browser_update_secondary_icon (browser, view, action); midori_location_action_set_text (location_action, midori_view_get_display_uri (MIDORI_VIEW (view))); #endif @@ -517,8 +520,6 @@ midori_view_notify_load_status_cb (GtkWidget* widget, { midori_location_action_set_text ( MIDORI_LOCATION_ACTION (action), uri); - midori_location_action_set_secondary_icon ( - MIDORI_LOCATION_ACTION (action), GTK_STOCK_JUMP_TO); g_object_notify (G_OBJECT (browser), "uri"); } @@ -3702,12 +3703,7 @@ _action_location_focus_out (GtkAction* action, if (!browser->show_navigationbar || midori_browser_is_fullscreen (browser)) gtk_widget_hide (browser->navigationbar); - if (g_object_get_data (G_OBJECT (view), "news-feeds")) - midori_location_action_set_secondary_icon ( - MIDORI_LOCATION_ACTION (action), STOCK_NEWS_FEED); - else - midori_location_action_set_secondary_icon ( - MIDORI_LOCATION_ACTION (action), GTK_STOCK_JUMP_TO); + midori_browser_update_secondary_icon (browser, MIDORI_VIEW (view), action); } static void