summaryrefslogtreecommitdiff
path: root/src/gui/menus
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-08-11 08:40:45 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-08-11 08:40:45 (GMT)
commit45c220eb6c7cb1076788307ace4b6f3df2e5e941 (patch)
treeb018cf25fc23190ec430afec0a612d29cb142757 /src/gui/menus
parentd19bfec27f4ed528c5ca569dcbb6621185db0c48 (diff)
Created a new widget to handle tiled panels.
Diffstat (limited to 'src/gui/menus')
-rw-r--r--src/gui/menus/view.c20
-rw-r--r--src/gui/menus/view.h3
2 files changed, 9 insertions, 14 deletions
diff --git a/src/gui/menus/view.c b/src/gui/menus/view.c
index 4dca039..bf8976c 100644
--- a/src/gui/menus/view.c
+++ b/src/gui/menus/view.c
@@ -46,9 +46,6 @@
/* Met à jour les accès du menu "Affichage -> Basculer...". */
static void update_switch_access_in_menu_view(void);
-/* Réagit avec le menu "Affichage -> Panneaux latéraux". */
-static void mcb_view_update_side_panels_list(GtkMenuItem *, GMenuBar *);
-
/* Réagit avec le menu "Affichage -> Panneaux latéraux -> ...". */
static void mcb_view_change_panel_docking(GtkCheckMenuItem *, GPanelItem *);
@@ -98,17 +95,12 @@ GtkWidget *build_menu_view(GObject *ref, GMenuBar *bar)
/* Affichage -> Panneaux latéraux */
- submenuitem = qck_create_menu_item(NULL, NULL, _("Side panels"), NULL, NULL);
+ submenuitem = qck_create_menu_item(ref, "mnu_view_side_panels", _("Side panels"), NULL, NULL);
g_signal_connect(submenuitem, "select", G_CALLBACK(mcb_view_update_side_panels_list), bar);
gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
qck_create_menu(GTK_MENU_ITEM(submenuitem));
- /**
- * Charge une liste initiale pour activer les raccourcis clavier.
- */
- mcb_view_update_side_panels_list(GTK_MENU_ITEM(submenuitem), bar);
-
/* Séparation */
submenuitem = qck_create_menu_separator();
@@ -117,12 +109,12 @@ GtkWidget *build_menu_view(GObject *ref, GMenuBar *bar)
/* Types de panneau de code */
- submenuitem = qck_create_menu_item(ref, "mcb_view_switch_to_next_support", _("Switch to next"),
+ submenuitem = qck_create_menu_item(ref, "mnu_view_switch_to_next_support", _("Switch to next"),
G_CALLBACK(mcb_view_switch_to_next_support), NULL);
add_accelerator_to_widget(submenuitem, "Tab");
gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
- submenuitem = qck_create_menu_item(ref, "mcb_view_switch_to_prev_support", _("Switch to previous"),
+ submenuitem = qck_create_menu_item(ref, "mnu_view_switch_to_prev_support", _("Switch to previous"),
G_CALLBACK(mcb_view_switch_to_prev_support), NULL);
add_accelerator_to_widget(submenuitem, "<Shift>Tab");
gtk_container_add(GTK_CONTAINER(menubar), submenuitem);
@@ -463,12 +455,12 @@ static void update_switch_access_in_menu_view(void)
access = (panel != NULL && (index + 1) < count);
- item = GTK_WIDGET(g_object_get_data(ref, "mcb_view_switch_to_next_support"));
+ item = GTK_WIDGET(g_object_get_data(ref, "mnu_view_switch_to_next_support"));
gtk_widget_set_sensitive(item, access);
access = (panel != NULL && index > 0);
- item = GTK_WIDGET(g_object_get_data(ref, "mcb_view_switch_to_prev_support"));
+ item = GTK_WIDGET(g_object_get_data(ref, "mnu_view_switch_to_prev_support"));
gtk_widget_set_sensitive(item, access);
if (panel != NULL)
@@ -493,7 +485,7 @@ static void update_switch_access_in_menu_view(void)
* *
******************************************************************************/
-static void mcb_view_update_side_panels_list(GtkMenuItem *menuitem, GMenuBar *bar)
+void mcb_view_update_side_panels_list(GtkMenuItem *menuitem, GMenuBar *bar)
{
GtkWidget *menubar; /* Support pour éléments */
diff --git a/src/gui/menus/view.h b/src/gui/menus/view.h
index a6491bd..2271d4c 100644
--- a/src/gui/menus/view.h
+++ b/src/gui/menus/view.h
@@ -46,6 +46,9 @@ void rebuild_menu_view_for_view(GtkWidget *, GLoadedPanel *);
/* Met à jour les accès du menu "Affichage" selon le contenu. */
void update_access_for_view_in_menu_view(GObject *, GLoadedPanel *);
+/* Réagit avec le menu "Affichage -> Panneaux latéraux". */
+void mcb_view_update_side_panels_list(GtkMenuItem *, GMenuBar *);
+
#endif /* _GUI_MENUS_VIEW_H */