[Xfce4-commits] <midori:master> Show "Menubar" menu in context menu if menubar and navibar are hidden

Christian Dywan noreply at xfce.org
Sat Sep 26 22:20:05 CEST 2009


Updating branch refs/heads/master
         to f294d79a74b04dcef6fd7edfb14b2325022648a4 (commit)
       from 55a2ecf710c304d602d3952ba6855f20ee181497 (commit)

commit f294d79a74b04dcef6fd7edfb14b2325022648a4
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Sep 26 22:08:16 2009 +0200

    Show "Menubar" menu in context menu if menubar and navibar are hidden
    
    It happens that users hide all toolbars and don't find a way to make
    them visible again. A menu item will be there for this case.

 midori/midori-browser.c |   10 ++++++++++
 midori/midori-view.c    |    7 +++++++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index 007e91d..042d856 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -2849,6 +2849,11 @@ _action_menubar_activate (GtkToggleAction* action,
             _midori_browser_save_toolbar_items (browser);
         }
     }
+
+    g_object_set_data (G_OBJECT (browser), "midori-toolbars-visible",
+        GTK_WIDGET_VISIBLE (browser->menubar)
+        || GTK_WIDGET_VISIBLE (browser->navigationbar)
+        ? (void*)0xdeadbeef : NULL);
     #endif
 }
 
@@ -2860,6 +2865,11 @@ _action_navigationbar_activate (GtkToggleAction* action,
     if (browser->settings)
         g_object_set (browser->settings, "show-navigationbar", active, NULL);
     sokoke_widget_set_visible (browser->navigationbar, active);
+
+    g_object_set_data (G_OBJECT (browser), "midori-toolbars-visible",
+        GTK_WIDGET_VISIBLE (browser->menubar)
+        || GTK_WIDGET_VISIBLE (browser->navigationbar)
+        ? (void*)0xdeadbeef : NULL);
 }
 
 static void
diff --git a/midori/midori-view.c b/midori/midori-view.c
index 3404dc4..942f9d7 100644
--- a/midori/midori-view.c
+++ b/midori/midori-view.c
@@ -1814,6 +1814,13 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view,
             G_CALLBACK (midori_web_view_menu_inspect_page_activate_cb), widget); */
         #endif
 
+        if (!g_object_get_data (G_OBJECT (browser), "midori-toolbars-visible"))
+        {
+            menuitem = sokoke_action_create_popup_menu_item (
+                gtk_action_group_get_action (actions, "Menubar"));
+            gtk_menu_shell_append (menu_shell, menuitem);
+        }
+
         menuitem = sokoke_action_create_popup_menu_item (
                 gtk_action_group_get_action (actions, "ZoomIn"));
         gtk_menu_shell_append (menu_shell, menuitem);



More information about the Xfce4-commits mailing list