diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-01-06 14:46:14 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-01-08 18:48:21 -0500 |
commit | e8b830a3ddbfe5d1b162e4dfa678d5e323c78267 (patch) | |
tree | 5fa9d9e1c59d6827addd6539014544965d5a2e0a /gtk/gtkpathbar.c | |
parent | 38974d7d2bc56496b45e1b7406d68a37009530d7 (diff) | |
download | gtk+-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/gtkpathbar.c')
-rw-r--r-- | gtk/gtkpathbar.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index 8c094cb946..248ff308ae 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -1366,10 +1366,11 @@ make_directory_button (GtkPathBar *path_bar, g_value_init (&value, G_TYPE_FILE); g_value_set_object (&value, button_data->file); + source = gtk_drag_source_new (); content = gdk_content_provider_new_for_value (&value); - source = gtk_drag_source_new (content, GDK_ACTION_COPY); - gtk_drag_source_attach (source, button_data->button, GDK_BUTTON1_MASK); + gtk_drag_source_set_content (source, content); g_object_unref (content); + gtk_drag_source_attach (source, button_data->button, GDK_BUTTON1_MASK); g_value_unset (&value); return button_data; |