]> spindle.queued.net Git - midori/commitdiff
Ensure that the menubar/ compact button visibility follows settings
authorChristian Dywan <christian@twotoasts.de>
Thu, 12 Nov 2009 22:56:04 +0000 (23:56 +0100)
committerChristian Dywan <christian@twotoasts.de>
Fri, 13 Nov 2009 01:18:18 +0000 (02:18 +0100)
When toggling the menubar it wouldn't always update all windows
to the same state.

midori/midori-browser.c

index 88b0534dad7796b6be1c7392afa499002aed1ed1..9b0cba5bcf3528ea0e7a9896d45223e602aca619 100644 (file)
@@ -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"))