summaryrefslogtreecommitdiff
path: root/src/gui/menus
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-07-19 23:16:29 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-07-19 23:16:29 (GMT)
commit5093663eb4e4aa17edd97cbd864ccb4a3d48a803 (patch)
tree48192ae6b37e1803d78ed81f5658ad9d2756cfd1 /src/gui/menus
parent12abead3f60d6f72c0d41672af87215dfc13c8fc (diff)
Given their own structure to rendering options.
Diffstat (limited to 'src/gui/menus')
-rw-r--r--src/gui/menus/view.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/gui/menus/view.c b/src/gui/menus/view.c
index d446278..31726c7 100644
--- a/src/gui/menus/view.c
+++ b/src/gui/menus/view.c
@@ -199,7 +199,7 @@ void rebuild_menu_view(GtkWidget *widget, GLoadedPanel *panel, GMenuBar *bar)
GSList *found; /* Elément de menu à activer */
GLoadedContent *content; /* Contenu global représenté */
unsigned int view_index; /* Indice de représentation */
- const bool *display; /* Règles d'affichage courantes*/
+ GDisplayOptions *options; /* Règles d'affichage courantes*/
GtkWidget *submenuitem; /* Sous-élément de menu */
bool status; /* Consigne d'affichage */
@@ -252,7 +252,7 @@ void rebuild_menu_view(GtkWidget *widget, GLoadedPanel *panel, GMenuBar *bar)
view_index = g_loaded_content_get_view_index(content, GTK_WIDGET(panel));
- display = g_loaded_content_get_all_display_options(content, view_index);
+ options = g_loaded_content_get_display_options(content, view_index);
g_object_unref(G_OBJECT(content));
@@ -262,7 +262,7 @@ void rebuild_menu_view(GtkWidget *widget, GLoadedPanel *panel, GMenuBar *bar)
g_signal_handlers_disconnect_by_func(submenuitem, G_CALLBACK(mcb_view_display_column), NULL);
- status = display[BLC_PHYSICAL];
+ status = g_display_options_get(options, BLC_PHYSICAL);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(submenuitem), status);
g_signal_connect(submenuitem, "toggled", G_CALLBACK(mcb_view_display_column), NULL);
@@ -273,7 +273,7 @@ void rebuild_menu_view(GtkWidget *widget, GLoadedPanel *panel, GMenuBar *bar)
g_signal_handlers_disconnect_by_func(submenuitem, G_CALLBACK(mcb_view_display_column), NULL);
- status = display[BLC_VIRTUAL];
+ status = g_display_options_get(options, BLC_VIRTUAL);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(submenuitem), status);
g_signal_connect(submenuitem, "toggled", G_CALLBACK(mcb_view_display_column), NULL);
@@ -284,11 +284,13 @@ void rebuild_menu_view(GtkWidget *widget, GLoadedPanel *panel, GMenuBar *bar)
g_signal_handlers_disconnect_by_func(submenuitem, G_CALLBACK(mcb_view_display_column), NULL);
- status = display[BLC_BINARY];
+ status = g_display_options_get(options, BLC_BINARY);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(submenuitem), status);
g_signal_connect(submenuitem, "toggled", G_CALLBACK(mcb_view_display_column), NULL);
+ g_object_unref(G_OBJECT(options));
+
}
@@ -708,6 +710,7 @@ static void mcb_view_display_column(GtkCheckMenuItem *menuitem, gpointer unused)
GLoadedPanel *panel; /* Afficheur effectif de code */
GLoadedContent *content; /* Contenu représenté */
unsigned int index; /* Indice de la vue courante */
+ GDisplayOptions *options; /* Ensemble à mettre à jour */
option = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(menuitem), "kind_of_opt"));
@@ -718,7 +721,11 @@ static void mcb_view_display_column(GtkCheckMenuItem *menuitem, gpointer unused)
index = g_loaded_content_get_view_index(content, GTK_WIDGET(panel));
- g_loaded_content_set_display_option(content, index, option, active);
+ options = g_loaded_content_get_display_options(content, index);
+
+ g_display_options_set(options, option, active);
+
+ g_object_unref(G_OBJECT(options));
g_object_unref(G_OBJECT(content));
g_object_unref(G_OBJECT(panel));