diff options
author | Benjamin Otte <otte@redhat.com> | 2020-02-02 00:27:14 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2020-02-04 16:41:36 +0100 |
commit | bbbe39fb44d2d9e40f0d92201f77e0680d2ff16a (patch) | |
tree | 14971b3436ceb5175562a502febabf6eab1c3d51 /tests/testdnd2.c | |
parent | b713b9f68dc443ca23e3fedaca7eb958741975d1 (diff) | |
download | gtk+-bbbe39fb44d2d9e40f0d92201f77e0680d2ff16a.tar.gz |
icontheme: Make text direction a lookup argument
Most users were just forgetting to set the proper flags.
And flags aren't the right way to set this anyway, it was just
acceptable as a workaround during GTK3 to not break API.
Diffstat (limited to 'tests/testdnd2.c')
-rw-r--r-- | tests/testdnd2.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/testdnd2.c b/tests/testdnd2.c index 7204ff7e9c..9fd2d02ea7 100644 --- a/tests/testdnd2.c +++ b/tests/testdnd2.c @@ -25,7 +25,11 @@ get_image_texture (GtkImage *image, icon_name = gtk_image_get_icon_name (image); icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (image))); *out_size = width; - icon = gtk_icon_theme_lookup_icon (icon_theme, icon_name, width, 1, GTK_ICON_LOOKUP_GENERIC_FALLBACK); + icon = gtk_icon_theme_lookup_icon (icon_theme, + icon_name, + width, 1, + gtk_widget_get_direction (GTK_WIDGET (image)), + GTK_ICON_LOOKUP_GENERIC_FALLBACK); if (icon) texture = gtk_icon_download_texture (icon, NULL); g_object_unref (icon); @@ -223,14 +227,16 @@ update_source_icon (GtkDragSource *source, const char *icon_name, int hotspot) { + GtkWidget *widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (source)); GtkIcon *icon; int hot_x, hot_y; int size = 48; - icon = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_for_display ( - gtk_widget_get_display ( - gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (source)))), - icon_name, size, 1, 0); + icon = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_for_display (gtk_widget_get_display (widget)), + icon_name, + size, 1, + gtk_widget_get_direction (widget), + 0); switch (hotspot) { default: |