add toolbar customize to main and burger menu

This commit is contained in:
Vincent Sanders 2019-09-03 23:32:31 +01:00 committed by Daniel Silverstone
parent 5f5b94c2ae
commit 1119707410
3 changed files with 26 additions and 13 deletions

View File

@ -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;
}

View File

@ -124,6 +124,7 @@ struct nsgtk_toolbars_submenu {
GtkMenu *toolbars_menu;
GtkCheckMenuItem *menubar_menuitem;
GtkCheckMenuItem *toolbar_menuitem;
GtkWidget *customize_menuitem;
};
struct nsgtk_developer_submenu {

View File

@ -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;
}