mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 14:10:30 +00:00
Use surface apis in testnotebookdnd
Stop using gtk_drag_set_icon_pixbuf. This api is going away.
This commit is contained in:
parent
89ad359628
commit
b72cda47fa
@ -96,7 +96,7 @@ on_notebook_drag_begin (GtkWidget *widget,
|
|||||||
GdkDragContext *context,
|
GdkDragContext *context,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
GdkPixbuf *pixbuf;
|
cairo_surface_t *surface;
|
||||||
guint page_num;
|
guint page_num;
|
||||||
|
|
||||||
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (widget));
|
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (widget));
|
||||||
@ -108,14 +108,15 @@ on_notebook_drag_begin (GtkWidget *widget,
|
|||||||
|
|
||||||
icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
|
icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget));
|
||||||
gtk_icon_size_lookup (GTK_ICON_SIZE_DND, &width, NULL);
|
gtk_icon_size_lookup (GTK_ICON_SIZE_DND, &width, NULL);
|
||||||
pixbuf = gtk_icon_theme_load_icon (icon_theme,
|
surface = gtk_icon_theme_load_surface (icon_theme,
|
||||||
(page_num % 2) ? "help-browser" : "process-stop",
|
(page_num % 2) ? "help-browser" : "process-stop",
|
||||||
width,
|
width,
|
||||||
GTK_ICON_LOOKUP_GENERIC_FALLBACK,
|
1, NULL,
|
||||||
NULL);
|
GTK_ICON_LOOKUP_GENERIC_FALLBACK,
|
||||||
|
NULL);
|
||||||
|
|
||||||
gtk_drag_set_icon_pixbuf (context, pixbuf, 0, 0);
|
gtk_drag_set_icon_surface (context, surface);
|
||||||
g_object_unref (pixbuf);
|
cairo_surface_destroy (surface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user