summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-08-18 21:51:36 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-08-18 21:51:36 (GMT)
commit0f73c1d378991c95a2f3080756cd1336aa829d35 (patch)
treeec41166dc86709fb024dc61632d24b30be401bf6
parent34ce5b73e72eeff2b9232d3aa3839726cfdcbf0f (diff)
Created a way to dock a panel without registering it.
-rw-r--r--src/gui/core/panels.c23
-rw-r--r--src/gui/core/panels.h3
2 files changed, 25 insertions, 1 deletions
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 *);