[dia] Bigger drop target for integrated UI case (whole notebook space)



commit 66b9aa9f87920ba7c103ddc27e85cb60f16d35cf
Author: Hans Breuer <hans breuer org>
Date:   Tue Dec 31 21:25:33 2013 +0100

    Bigger drop target for integrated UI case (whole notebook space)

 app/interface.c |    7 ++++++-
 app/toolbox.c   |    9 ++++++++-
 app/toolbox.h   |    1 +
 3 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/app/interface.c b/app/interface.c
index ed85097..1d11680 100644
--- a/app/interface.c
+++ b/app/interface.c
@@ -430,7 +430,7 @@ create_canvas (DDisplay *ddisp)
                     G_CALLBACK(ddisplay_canvas_events),
                     ddisp);
 
-  toolbox_setup_drag_dest (canvas);
+  canvas_setup_drag_dest (canvas);
   g_signal_connect (G_OBJECT (canvas), "drag_drop",
                    G_CALLBACK(display_drop_callback), NULL);
   g_signal_connect (G_OBJECT (canvas), "drag_data_received",
@@ -980,6 +980,11 @@ create_integrated_ui (void)
   g_signal_connect (G_OBJECT (wrapbox), "drag_data_received",
                    G_CALLBACK (dia_dnd_file_drag_data_received),
                     NULL); /* userdata == NULL here intentionally */
+  /* setup the notebook to receive drops as well */
+  toolbox_setup_drag_dest (notebook);
+  g_signal_connect (G_OBJECT (notebook), "drag_data_received",
+                   G_CALLBACK (dia_dnd_file_drag_data_received),
+                    NULL); /* userdata == NULL here intentionally */
 
   /* menus -- initialised afterwards, because initing the display menus
    * uses the tool buttons*/
diff --git a/app/toolbox.c b/app/toolbox.c
index cb9c03c..8fdb424 100644
--- a/app/toolbox.c
+++ b/app/toolbox.c
@@ -754,7 +754,14 @@ toolbox_create(void)
 }
 
 void
-toolbox_setup_drag_dest (GtkWidget *canvas)
+toolbox_setup_drag_dest (GtkWidget *widget)
+{
+  gtk_drag_dest_set(widget, GTK_DEST_DEFAULT_ALL,
+                   toolbox_target_table, toolbox_n_targets, GDK_ACTION_COPY);
+}
+
+void
+canvas_setup_drag_dest (GtkWidget *canvas)
 {
   gtk_drag_dest_set(canvas, GTK_DEST_DEFAULT_ALL,
                    display_target_table, display_n_targets, GDK_ACTION_COPY);
diff --git a/app/toolbox.h b/app/toolbox.h
index 014771a..089766b 100644
--- a/app/toolbox.h
+++ b/app/toolbox.h
@@ -29,6 +29,7 @@ void tool_select_update (GtkWidget *w, gpointer   data);
 GdkPixbuf *tool_get_pixbuf (ToolButton *tb);
 
 void toolbox_setup_drag_dest (GtkWidget *canvas);
+void canvas_setup_drag_dest (GtkWidget *canvas);
 GtkWidget *toolbox_create(void);
 
 void fill_sheet_menu(void);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]