]> spindle.queued.net Git - midori/commitdiff
Show "Menubar" menu in context menu if menubar and navibar are hidden
authorChristian Dywan <christian@twotoasts.de>
Sat, 26 Sep 2009 20:08:16 +0000 (22:08 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sat, 26 Sep 2009 20:19:34 +0000 (22:19 +0200)
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
midori/midori-view.c

index 007e91d1497cb95ef2c9aeaa82d29f3bd857c2f2..042d8560c989d0ba29c6e76177b160e41fab5e07 100644 (file)
@@ -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
index 3404dc4b4dcb7e8742288db21c3e63d2364f06ed..942f9d7852fd49adf7f51490a4085d21dd83eb94 100644 (file)
@@ -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);