summaryrefslogtreecommitdiff
path: root/frontends/gtk
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2019-09-03 23:32:31 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2019-09-21 10:53:41 +0100
commit11197074102a46cb85d108f0915fc2929e79b26a (patch)
tree2787a2726b7e62102e0872da5cf6ec9917bcdb21 /frontends/gtk
parent5f5b94c2aee697e2da5ab6819b19a00b83f50390 (diff)
downloadnetsurf-11197074102a46cb85d108f0915fc2929e79b26a.tar.gz
netsurf-11197074102a46cb85d108f0915fc2929e79b26a.tar.bz2
add toolbar customize to main and burger menu
Diffstat (limited to 'frontends/gtk')
-rw-r--r--frontends/gtk/menu.c15
-rw-r--r--frontends/gtk/menu.h1
-rw-r--r--frontends/gtk/scaffolding.c23
3 files changed, 26 insertions, 13 deletions
diff --git a/frontends/gtk/menu.c b/frontends/gtk/menu.c
index 3e144f025..6589fcacd 100644
--- a/frontends/gtk/menu.c
+++ b/frontends/gtk/menu.c
@@ -217,12 +217,12 @@ static struct nsgtk_tabs_submenu *nsgtk_menu_tabs_submenu(GtkAccelGroup *group)
/**
-* creates a toolbars submenu
-* \param group the 'global' in a gtk sense accelerator reference
-*/
-
-static struct nsgtk_toolbars_submenu *nsgtk_menu_toolbars_submenu(
- GtkAccelGroup *group)
+ * creates a toolbars submenu
+ *
+ * \param group the 'global' in a gtk sense accelerator reference
+ */
+static struct nsgtk_toolbars_submenu *
+nsgtk_menu_toolbars_submenu(GtkAccelGroup *group)
{
struct nsgtk_toolbars_submenu *ret =
malloc(sizeof(struct nsgtk_toolbars_submenu));
@@ -242,6 +242,9 @@ static struct nsgtk_toolbars_submenu *nsgtk_menu_toolbars_submenu(
CHECK_ITEM(toolbars, toolbar, gtkToolBar, ret)
if (ret->toolbar_menuitem != NULL)
gtk_check_menu_item_set_active(ret->toolbar_menuitem, TRUE);
+ ADD_SEP(toolbars, ret);
+ IMAGE_ITEM(toolbars, customize, gtkCustomize, ret, group);
+
return ret;
}
diff --git a/frontends/gtk/menu.h b/frontends/gtk/menu.h
index 1ef3187be..4656e225c 100644
--- a/frontends/gtk/menu.h
+++ b/frontends/gtk/menu.h
@@ -124,6 +124,7 @@ struct nsgtk_toolbars_submenu {
GtkMenu *toolbars_menu;
GtkCheckMenuItem *menubar_menuitem;
GtkCheckMenuItem *toolbar_menuitem;
+ GtkWidget *customize_menuitem;
};
struct nsgtk_developer_submenu {
diff --git a/frontends/gtk/scaffolding.c b/frontends/gtk/scaffolding.c
index e0ca65aca..50e061eb1 100644
--- a/frontends/gtk/scaffolding.c
+++ b/frontends/gtk/scaffolding.c
@@ -757,19 +757,16 @@ static void nsgtk_menu_connect_signals(struct nsgtk_scaffolding *g)
"toggled",
G_CALLBACK(nsgtk_on_menubar_activate_menu),
g);
- g_signal_connect(g->burger_menu->view_submenu->toolbars_submenu->menubar_menuitem,
- "toggled",
- G_CALLBACK(nsgtk_on_menubar_activate_menu),
- g);
g_signal_connect(g->menu_bar->view_submenu->toolbars_submenu->toolbar_menuitem,
"toggled",
G_CALLBACK(nsgtk_on_toolbar_activate_menu),
g);
- g_signal_connect(g->burger_menu->view_submenu->toolbars_submenu->toolbar_menuitem,
- "toggled",
- G_CALLBACK(nsgtk_on_toolbar_activate_menu),
+ g_signal_connect(g->menu_bar->view_submenu->toolbars_submenu->customize_menuitem,
+ "activate",
+ G_CALLBACK(nsgtk_on_customize_activate_menu),
g);
+
}
@@ -791,6 +788,18 @@ create_scaffolding_burger_menu(struct nsgtk_scaffolding *gs,
if (nmenu == NULL) {
return NULL;
}
+ g_signal_connect(nmenu->view_submenu->toolbars_submenu->menubar_menuitem,
+ "toggled",
+ G_CALLBACK(nsgtk_on_menubar_activate_menu),
+ gs);
+ g_signal_connect(nmenu->view_submenu->toolbars_submenu->toolbar_menuitem,
+ "toggled",
+ G_CALLBACK(nsgtk_on_toolbar_activate_menu),
+ gs);
+ g_signal_connect(nmenu->view_submenu->toolbars_submenu->customize_menuitem,
+ "activate",
+ G_CALLBACK(nsgtk_on_customize_activate_menu),
+ gs);
return nmenu;
}