Commit 5f6d0724 authored by Matthias Clasen's avatar Matthias Clasen

gtk-demo: Fix the dnd demo drop highlight

We want the drop highlight to be around the label,
not around the item containing it, so move the drop
target gesture to the right widget.
parent 0dc38426
Pipeline #181799 passed with stages
in 69 minutes and 47 seconds
......@@ -62,7 +62,8 @@ item_drag_drop (GtkDropTarget *dest,
double x,
double y)
CanvasItem *item = CANVAS_ITEM (gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (dest)));
GtkWidget *label = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (dest));
CanvasItem *item = CANVAS_ITEM (gtk_widget_get_parent (gtk_widget_get_parent (label)));
set_color (item, g_value_get_boxed (value));
......@@ -155,7 +156,7 @@ canvas_item_init (CanvasItem *item)
dest = gtk_drop_target_new (GDK_TYPE_RGBA, GDK_ACTION_COPY);
g_signal_connect (dest, "drop", G_CALLBACK (item_drag_drop), NULL);
gtk_widget_add_controller (GTK_WIDGET (item), GTK_EVENT_CONTROLLER (dest));
gtk_widget_add_controller (GTK_WIDGET (item->label), GTK_EVENT_CONTROLLER (dest));
gesture = gtk_gesture_rotate_new ();
g_signal_connect (gesture, "angle-changed", G_CALLBACK (angle_changed), NULL);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment