mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-30 15:31:34 +00:00
placessidebar: Fix the bookmark drag icon
Just use the widget; a paintable only works if the widget it is based on actually gets drawn, the clone we create here wasn't.
This commit is contained in:
parent
4eaf08e964
commit
e18de295c6
@ -61,7 +61,6 @@
|
||||
#include "gtknative.h"
|
||||
#include "gtkdragsource.h"
|
||||
#include "gtkdragicon.h"
|
||||
#include "gtkwidgetpaintable.h"
|
||||
#include "gtkstylecontext.h"
|
||||
|
||||
/*< private >
|
||||
@ -3475,7 +3474,6 @@ on_row_dragged (GtkGestureDrag *gesture,
|
||||
GdkDevice *device;
|
||||
GtkAllocation allocation;
|
||||
GtkWidget *drag_widget;
|
||||
GdkPaintable *paintable;
|
||||
GdkDrag *drag;
|
||||
|
||||
gtk_gesture_drag_get_start_point (gesture, &start_x, &start_y);
|
||||
@ -3501,17 +3499,11 @@ on_row_dragged (GtkGestureDrag *gesture,
|
||||
gtk_widget_hide (sidebar->drag_row);
|
||||
|
||||
drag_widget = GTK_WIDGET (gtk_sidebar_row_clone (GTK_SIDEBAR_ROW (sidebar->drag_row)));
|
||||
g_object_ref_sink (drag_widget);
|
||||
sidebar->drag_row_height = allocation.height;
|
||||
gtk_widget_set_size_request (drag_widget, allocation.width, allocation.height);
|
||||
|
||||
gtk_widget_set_opacity (drag_widget, 0.8);
|
||||
|
||||
paintable = gtk_widget_paintable_new (drag_widget);
|
||||
gtk_drag_icon_set_from_paintable (drag, paintable, sidebar->drag_row_x, sidebar->drag_row_y);
|
||||
g_object_unref (paintable);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (drag), "row-widget", drag_widget, (GDestroyNotify)g_object_unref);
|
||||
gtk_drag_icon_set_child (GTK_DRAG_ICON (gtk_drag_icon_get_for_drag (drag)), drag_widget);
|
||||
|
||||
g_object_unref (drag);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user