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.
This commit is contained in:
Christian Dywan 2009-09-26 22:08:16 +02:00
parent 55a2ecf710
commit f294d79a74
2 changed files with 17 additions and 0 deletions

View 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

View 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);