From: Christian Dywan Date: Thu, 12 Nov 2009 22:56:04 +0000 (+0100) Subject: Ensure that the menubar/ compact button visibility follows settings X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ab4123c3f5021a363981fe19ab0ae7f415f7138;p=midori Ensure that the menubar/ compact button visibility follows settings When toggling the menubar it wouldn't always update all windows to the same state. --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 88b0534d..9b0cba5b 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -3082,12 +3082,9 @@ _action_menubar_activate (GtkToggleAction* action, MidoriBrowser* browser) { gboolean active = gtk_toggle_action_get_active (action); - if (browser->settings) - g_object_set (browser->settings, "show-menubar", active, NULL); - sokoke_widget_set_visible (browser->menubar, active); - #if !HAVE_HILDON if (browser->settings) { + #if !HAVE_HILDON if (active) { GtkContainer* navigationbar = GTK_CONTAINER (browser->navigationbar); @@ -3118,13 +3115,16 @@ _action_menubar_activate (GtkToggleAction* action, browser); _midori_browser_save_toolbar_items (browser); } + #endif + g_object_set (browser->settings, "show-menubar", active, NULL); } + /* Make sure the menubar is uptodate in case no settings are set */ + sokoke_widget_set_visible (browser->menubar, active); g_object_set_data (G_OBJECT (browser), "midori-toolbars-visible", GTK_WIDGET_VISIBLE (browser->menubar) || GTK_WIDGET_VISIBLE (browser->navigationbar) ? (void*)0xdeadbeef : NULL); - #endif } static void @@ -6114,6 +6114,8 @@ midori_browser_settings_notify (MidoriWebSettings* web_settings, } else if (name == g_intern_string ("always-show-tabbar")) _toggle_tabbar_smartly (browser); + else if (name == g_intern_string ("show-menubar")) + sokoke_widget_set_visible (browser->menubar, g_value_get_boolean (&value)); else if (name == g_intern_string ("show-navigationbar")) browser->show_navigationbar = g_value_get_boolean (&value); else if (name == g_intern_string ("show-statusbar"))