diff options
author | Ondrej Holy <oholy@redhat.com> | 2022-02-11 14:27:53 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2022-02-11 14:59:48 +0100 |
commit | c70fd032f18b0921798ee8eb9069d308cbde0f9b (patch) | |
tree | 385c4d3a0931f62e92d708461e99c3014b1af949 | |
parent | 6c6596a988517e288d7afbff4de77c238c967ac6 (diff) | |
download | nautilus-c70fd032f18b0921798ee8eb9069d308cbde0f9b.tar.gz |
Revert "properties-window: Drop HiDPI icon support"
This reverts commit f3fea0fe1574b8a290bc1d58c5a1c6dd67dd7077.
-rw-r--r-- | src/nautilus-properties-window.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c index 2a6e7b6ff..804a993bb 100644 --- a/src/nautilus-properties-window.c +++ b/src/nautilus-properties-window.c @@ -401,8 +401,6 @@ get_image_for_properties_window (NautilusPropertiesWindow *self, gint icon_scale; icon_scale = gtk_widget_get_scale_factor (GTK_WIDGET (self->notebook)); - /* FIXME: Temporary regression: HiDPI icons not supported, ignore scale. */ - icon_scale = 1; for (l = self->original_files; l != NULL; l = l->next) { @@ -454,6 +452,7 @@ static void update_properties_window_icon (NautilusPropertiesWindow *self) { g_autoptr (GdkPixbuf) pixbuf = NULL; + cairo_surface_t *surface; g_autofree char *name = NULL; get_image_for_properties_window (self, &name, &pixbuf); @@ -463,8 +462,12 @@ update_properties_window_icon (NautilusPropertiesWindow *self) gtk_window_set_icon_name (GTK_WINDOW (self), name); } - gtk_image_set_from_pixbuf (GTK_IMAGE (self->icon_image), pixbuf); - gtk_image_set_from_pixbuf (GTK_IMAGE (self->icon_button_image), pixbuf); + surface = gdk_cairo_surface_create_from_pixbuf (pixbuf, gtk_widget_get_scale_factor (GTK_WIDGET (self)), + gtk_widget_get_window (GTK_WIDGET (self))); + gtk_image_set_from_surface (GTK_IMAGE (self->icon_image), surface); + gtk_image_set_from_surface (GTK_IMAGE (self->icon_button_image), surface); + + cairo_surface_destroy (surface); } /* utility to test if a uri refers to a local image */ |