summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/editor.c13
-rw-r--r--src/gui/panels/view.c15
2 files changed, 27 insertions, 1 deletions
diff --git a/src/gui/editor.c b/src/gui/editor.c
index 1665ff4..c7c2d37 100644
--- a/src/gui/editor.c
+++ b/src/gui/editor.c
@@ -1030,11 +1030,22 @@ static void on_editor_content_available(GStudyProject *project, GLoadedContent *
static void on_editor_loaded_content_added(GStudyProject *project, GLoadedContent *content, void *unused)
{
GPanelItem *panel; /* Nouveau panneau à integrer */
+ GPanelItemClass *class; /* Classe associée au panneau */
+#ifndef NDEBUG
+ bool status; /* Bilan de mise en place */
+#endif
GtkWidget *selected; /* Interface de prédilection */
panel = g_view_panel_new(G_NAMED_WIDGET(content));
- register_panel_item(G_TYPE_VIEW_PANEL, get_main_configuration());
+ class = G_PANEL_ITEM_GET_CLASS(panel);
+
+#ifndef NDEBUG
+ status = gtk_panel_item_class_setup_configuration(class, get_main_configuration());
+ assert(status);
+#else
+ gtk_panel_item_class_setup_configuration(class, get_main_configuration());
+#endif
selected = g_editor_item_get_widget(G_EDITOR_ITEM(panel));
diff --git a/src/gui/panels/view.c b/src/gui/panels/view.c
index 26dc820..391c9c6 100644
--- a/src/gui/panels/view.c
+++ b/src/gui/panels/view.c
@@ -29,7 +29,10 @@
#include "../panel-int.h"
+#include "../core/global.h"
+#include "../core/items.h"
#include "../../gtkext/named.h"
+#include "../../plugins/pglist.h"
@@ -250,12 +253,24 @@ static char *g_view_panel_class_get_path(const GViewPanelClass *class)
GPanelItem *g_view_panel_new(GNamedWidget *widget)
{
GPanelItem *result; /* Structure à retourner */
+ GtkTiledGrid *grid; /* Composant d'affichage */
result = g_object_new(G_TYPE_VIEW_PANEL, NULL);
result->widget = widget;
g_object_ref(G_OBJECT(widget));
+ grid = get_tiled_grid();
+
+ g_signal_connect_swapped(result, "dock-request", G_CALLBACK(gtk_tiled_grid_add), grid);
+ g_signal_connect_swapped(result, "undock-request", G_CALLBACK(gtk_tiled_grid_remove), grid);
+
+ gtk_dockable_setup_dnd(GTK_DOCKABLE(result));
+
+ register_editor_item(G_EDITOR_ITEM(result));
+
+ notify_panel_creation(result);
+
return result;
}