diff options
author | Benjamin Otte <otte@redhat.com> | 2018-04-02 08:12:37 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2018-04-05 14:56:39 +0200 |
commit | a595a4c2ce4f851a4804bfbd273e953cacff5e25 (patch) | |
tree | e402715174ae670a127a3abdc36c837a96118d4e /tests | |
parent | f974b4850351acb277b6f44ef78c49ee2b7c223b (diff) | |
download | gtk+-a595a4c2ce4f851a4804bfbd273e953cacff5e25.tar.gz |
testlist3: Set the actual row as drag icon
(Well, don't do anything actually, because dnd is broken, but
in theory...)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testlist3.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/tests/testlist3.c b/tests/testlist3.c index cb604057e1..4f5e757638 100644 --- a/tests/testlist3.c +++ b/tests/testlist3.c @@ -11,25 +11,13 @@ drag_begin (GtkWidget *widget, { GtkWidget *row; GtkAllocation alloc; - GtkSnapshot *snapshot; GdkPaintable *paintable; - cairo_t *cr; int x, y; row = gtk_widget_get_ancestor (widget, GTK_TYPE_LIST_BOX_ROW); gtk_widget_get_allocation (row, &alloc); - snapshot = gtk_snapshot_new (FALSE, "DragIcon"); - cr = gtk_snapshot_append_cairo (snapshot, - &GRAPHENE_RECT_INIT(0, 0, alloc.width, alloc.height), - "DragText"); - - gtk_style_context_add_class (gtk_widget_get_style_context (row), "during-dnd"); - gtk_widget_draw (row, cr); - gtk_style_context_remove_class (gtk_widget_get_style_context (row), "during-dnd"); - - cairo_destroy (cr); - paintable = gtk_snapshot_free_to_paintable (snapshot, NULL); + paintable = gtk_widget_paintable_new (row); gtk_widget_translate_coordinates (widget, row, 0, 0, &x, &y); gtk_drag_set_icon_paintable (context, paintable, -x, -y); |