[Xfce4-commits] <midori:master> Replace Panel in app menu with individual panels
Christian Dywan
noreply at xfce.org
Thu Jul 5 20:36:01 CEST 2012
Updating branch refs/heads/master
to d319d4041642eac95974b46e67a05d4b26bccab3 (commit)
from 21b643c8255bbdab29631d39f3f2bffb9f347166 (commit)
commit d319d4041642eac95974b46e67a05d4b26bccab3
Author: Christian Dywan <christian at twotoasts.de>
Date: Thu Jul 5 20:34:09 2012 +0200
Replace Panel in app menu with individual panels
So users will see "Bookmarks" and "History" and hopefully
that's more discoverable than "Sidepanel".
midori/midori-browser.c | 22 +++++++++++++++++++---
midori/midori-panel.c | 6 ++++--
2 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/midori/midori-browser.c b/midori/midori-browser.c
index a193407..7c64822 100644
--- a/midori/midori-browser.c
+++ b/midori/midori-browser.c
@@ -199,7 +199,8 @@ _midori_browser_set_toolbar_style (MidoriBrowser* browser,
GtkWidget*
midori_panel_construct_menu_item (MidoriPanel* panel,
- MidoriViewable* viewable);
+ MidoriViewable* viewable,
+ gboolean popup);
static void
midori_browser_settings_notify (MidoriWebSettings* web_settings,
@@ -3008,7 +3009,7 @@ _action_tools_populate_popup (GtkAction* action,
j = 0;
while ((widget = midori_panel_get_nth_page (panel, j++)))
{
- menuitem = midori_panel_construct_menu_item (panel, MIDORI_VIEWABLE (widget));
+ menuitem = midori_panel_construct_menu_item (panel, MIDORI_VIEWABLE (widget), FALSE);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
}
continue;
@@ -3158,7 +3159,7 @@ _action_compact_menu_populate_popup (GtkAction* action,
{ "BookmarksExport"},
{ NULL },
{ "Fullscreen" },
- { "Panel" },
+ { "p" },
{ "-" },
#endif
{ NULL },
@@ -3213,6 +3214,21 @@ _action_compact_menu_populate_popup (GtkAction* action,
g_signal_emit (browser, signals[POPULATE_TOOL_MENU], 0, menu);
continue;
}
+ else if (actions[i].name[0] == 'p')
+ {
+ MidoriPanel* panel;
+ gsize j;
+ GtkWidget* widget;
+
+ panel = MIDORI_PANEL (browser->panel);
+ j = 0;
+ while ((widget = midori_panel_get_nth_page (panel, j++)))
+ {
+ menuitem = midori_panel_construct_menu_item (panel, MIDORI_VIEWABLE (widget), TRUE);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+ }
+ continue;
+ }
menuitem = sokoke_action_create_popup_menu_item (
_action_by_name (browser, actions[i].name));
}
diff --git a/midori/midori-panel.c b/midori/midori-panel.c
index 2c2b12b..dd10c8f 100644
--- a/midori/midori-panel.c
+++ b/midori/midori-panel.c
@@ -489,13 +489,15 @@ midori_panel_set_right_aligned (MidoriPanel* panel,
/* Private function, used by MidoriBrowser */
/* static */ GtkWidget*
midori_panel_construct_menu_item (MidoriPanel* panel,
- MidoriViewable* viewable)
+ MidoriViewable* viewable,
+ gboolean popup)
{
GtkAction* action;
GtkWidget* menuitem;
action = g_object_get_data (G_OBJECT (viewable), "midori-panel-action");
- menuitem = gtk_action_create_menu_item (action);
+ menuitem = popup ? sokoke_action_create_popup_menu_item (action)
+ : gtk_action_create_menu_item (action);
g_object_set_data (G_OBJECT (menuitem), "page", viewable);
if (gtk_widget_get_visible (GTK_WIDGET (viewable)))
More information about the Xfce4-commits
mailing list