[nautilus/gtk4-preparation-trunk: 54/64] properties-window: Drop HiDPI icon support
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/gtk4-preparation-trunk: 54/64] properties-window: Drop HiDPI icon support
- Date: Thu, 23 Dec 2021 02:10:17 +0000 (UTC)
commit d56cae110c72701b271b940ba0541df60411897b
Author: António Fernandes <antoniof gnome org>
Date: Wed Dec 15 16:55:49 2021 +0000
properties-window: Drop HiDPI icon support
gdk_cairo_surface_create_from_pixbuf() is gone in GDK 4. A replacement
cannot be easily implemented in GTK 3 which would be portable to GTK 4.
Take this temporary regression, to be fixed with paintables in GTK 4.
src/nautilus-properties-window.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 873857cf5..9ae34ccda 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -400,6 +400,8 @@ 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)
{
@@ -451,7 +453,6 @@ 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);
@@ -461,12 +462,8 @@ update_properties_window_icon (NautilusPropertiesWindow *self)
gtk_window_set_icon_name (GTK_WINDOW (self), name);
}
- 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);
+ gtk_image_set_from_pixbuf (GTK_IMAGE (self->icon_image), pixbuf);
+ gtk_image_set_from_pixbuf (GTK_IMAGE (self->icon_button_image), pixbuf);
}
/* utility to test if a uri refers to a local image */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]