[Xfce4-commits] <midori:master> Only show 'go to' in location to indicate focus
Christian Dywan
noreply at xfce.org
Sat Apr 21 22:56:02 CEST 2012
Updating branch refs/heads/master
to e29af0b6340c0630329ff86b3613171b9d89a5d5 (commit)
from 1a5f96013d364498dfae584534f0834f8bccaf58 (commit)
commit e29af0b6340c0630329ff86b3613171b9d89a5d5
Author: Christian Dywan <christian at twotoasts.de>
Date: Sat Apr 21 22:38:26 2012 +0200
Only show 'go to' in location to indicate focus
Fixes: https://bugs.launchpad.net/midori/+bug/699965
midori/midori-browser.c | 48 +++++++++++++++++++++-------------------------
1 files changed, 22 insertions(+), 26 deletions(-)
diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 996b88e..0697a7f 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -285,6 +285,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)
{
GtkWidget* widget = midori_browser_get_current_tab (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
More information about the Xfce4-commits
mailing list