summaryrefslogtreecommitdiff
path: root/src/gui/menus
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/menus')
-rw-r--r--src/gui/menus/view.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/gui/menus/view.c b/src/gui/menus/view.c
index 37db20a..02cfa1d 100644
--- a/src/gui/menus/view.c
+++ b/src/gui/menus/view.c
@@ -42,6 +42,7 @@
#include "../../gtkext/easygtk.h"
#include "../../gtkext/gtkdisplaypanel.h"
#include "../../gtkext/gtkgraphdisplay.h"
+#include "../../plugins/dt.h"
@@ -173,8 +174,11 @@ static void remove_panel_menu_item(GtkWidget *widget, GtkContainer *container)
static bool add_side_panel_to_list(GPanelItemClass *class, panels_loading_filter *filter)
{
- gpointer type_ptr; /* Type de panneau traité */
- char *key; /* Désignation de l'entrée */
+ GType type; /* Type de panneau traité */
+ gpointer type_ptr; /* Autre forme d'encodage */
+ GPanelItem *panel; /* Panneau à manipuler */
+ GNamedWidget *named; /* Composant nommé associé */
+ char *label; /* Désignation de l'entrée */
GtkWidget *submenuitem; /* Sous-élément de menu */
char *bindings; /* Raccourcis clavier bruts */
GtkBuilder *builder; /* Constructeur principal */
@@ -196,14 +200,21 @@ static bool add_side_panel_to_list(GPanelItemClass *class, panels_loading_filter
/* Elément de menu */
- type_ptr = GSIZE_TO_POINTER(G_TYPE_FROM_CLASS(class));
+ type = G_TYPE_FROM_CLASS(class);
+ type_ptr = GSIZE_TO_POINTER(type);
- key = g_editor_item_class_get_key(G_EDITOR_ITEM_CLASS(class));
+ panel = create_object_from_type(type);
+ named = gtk_panel_item_get_named_widget(panel);
- submenuitem = qck_create_check_menu_item(NULL, NULL, key,
+ label = g_named_widget_get_name(named, false);
+
+ submenuitem = qck_create_check_menu_item(NULL, NULL, label,
G_CALLBACK(mcb_view_change_panel_docking), type_ptr);
- free(key);
+ free(label);
+
+ g_object_unref(G_OBJECT(named));
+ g_object_unref(G_OBJECT(panel));
bindings = gtk_panel_item_class_get_key_bindings(class);
@@ -221,7 +232,7 @@ static bool add_side_panel_to_list(GPanelItemClass *class, panels_loading_filter
/* Statut de la coche */
- item = find_editor_item_by_type(G_TYPE_FROM_CLASS(class));
+ item = find_editor_item_by_type(type);
if (item != NULL)
{