[Xfce4-commits] <midori:master> Ensure that the menubar/ compact button visibility follows settings

Christian Dywan noreply at xfce.org
Fri Nov 13 02:24:02 CET 2009


Updating branch refs/heads/master
         to 8ab4123c3f5021a363981fe19ab0ae7f415f7138 (commit)
       from 2fc6a2be891509e16654dd5af8e0af562db7a579 (commit)

commit 8ab4123c3f5021a363981fe19ab0ae7f415f7138
Author: Christian Dywan <christian at twotoasts.de>
Date:   Thu Nov 12 23:56:04 2009 +0100

    Ensure that the menubar/ compact button visibility follows settings
    
    When toggling the menubar it wouldn't always update all windows
    to the same state.

 midori/midori-browser.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 88b0534..9b0cba5 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -3083,11 +3083,8 @@ _action_menubar_activate (GtkToggleAction* action,
 {
     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"))



More information about the Xfce4-commits mailing list