From 0f73c1d378991c95a2f3080756cd1336aa829d35 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Sat, 18 Aug 2018 23:51:36 +0200 Subject: Created a way to dock a panel without registering it. --- src/gui/core/panels.c | 23 ++++++++++++++++++++++- src/gui/core/panels.h | 3 +++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/gui/core/panels.c b/src/gui/core/panels.c index 60ff6f2..4564f86 100644 --- a/src/gui/core/panels.c +++ b/src/gui/core/panels.c @@ -116,7 +116,6 @@ void load_main_panels(void) void register_panel_item(GPanelItem *item, GGenConfig *config) { GEditorItem *parent; /* Autre version de l'élément */ - GtkTiledGrid *grid; /* Composant d'affichage */ parent = G_EDITOR_ITEM(item); @@ -124,6 +123,28 @@ void register_panel_item(GPanelItem *item, GGenConfig *config) register_editor_item(parent); panels_list_add_tail(item, &_panels_list); + activate_panel_item(item, config); + +} + + +/****************************************************************************** +* * +* Paramètres : item = composant à présenter à l'affichage. * +* config = configuration à compléter. * +* * +* Description : Intègre un panneau comme partie intégrante de l'éditeur. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void activate_panel_item(GPanelItem *item, GGenConfig *config) +{ + GtkTiledGrid *grid; /* Composant d'affichage */ + grid = get_tiled_grid(); g_signal_connect_swapped(item, "dock-request", G_CALLBACK(gtk_tiled_grid_add), grid); diff --git a/src/gui/core/panels.h b/src/gui/core/panels.h index 477c1e0..5344f3d 100644 --- a/src/gui/core/panels.h +++ b/src/gui/core/panels.h @@ -40,6 +40,9 @@ void load_main_panels(void); /* Enregistre un panneau comme partie intégrante de l'éditeur. */ void register_panel_item(GPanelItem *, GGenConfig *); +/* Intègre un panneau comme partie intégrante de l'éditeur. */ +void activate_panel_item(GPanelItem *, GGenConfig *); + /* Réalise un traitement sur un panneau de l'éditeur. */ typedef bool (* handle_panel_item_fc) (GPanelItem *, void *); -- cgit v0.11.2-87-g4458