summaryrefslogtreecommitdiff
path: root/gtk/gtkcolorswatch.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-01-06 14:46:14 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-01-08 18:48:21 -0500
commite8b830a3ddbfe5d1b162e4dfa678d5e323c78267 (patch)
tree5fa9d9e1c59d6827addd6539014544965d5a2e0a /gtk/gtkcolorswatch.c
parent38974d7d2bc56496b45e1b7406d68a37009530d7 (diff)
downloadgtk+-e8b830a3ddbfe5d1b162e4dfa678d5e323c78267.tar.gz
dragsource: Reshuffle api a bit
Remove arguments from the constructor. For actions, we now default to COPY, which is the most common one that we should enable by default (MOVE requires handling deletion on the the source side, and ASK only makes sense if we have multiple actions). For the content provider, we add a new ::prepare signal where it should be provided just-in-time.
Diffstat (limited to 'gtk/gtkcolorswatch.c')
-rw-r--r--gtk/gtkcolorswatch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c
index 9bdcca3e83..d693709669 100644
--- a/gtk/gtkcolorswatch.c
+++ b/gtk/gtkcolorswatch.c
@@ -601,8 +601,9 @@ gtk_color_swatch_set_rgba (GtkColorSwatch *swatch,
GdkContentProvider *content;
GtkDragSource *source;
+ source = gtk_drag_source_new ();
content = gdk_content_provider_new_with_callback (GDK_TYPE_RGBA, get_rgba_value, swatch);
- source = gtk_drag_source_new (content, GDK_ACTION_COPY);
+ gtk_drag_source_set_content (source, content);
g_object_unref (content);
g_signal_connect (source, "drag-begin", G_CALLBACK (gtk_color_swatch_drag_begin), swatch);