[nautilus/wip/antoniof/experimental-gtk4-build: 1/7] properties-window: Set Image pixel size
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/experimental-gtk4-build: 1/7] properties-window: Set Image pixel size
- Date: Sun, 2 Jan 2022 12:49:08 +0000 (UTC)
commit 97d7b959f0eba8edc0c379b6362bdff08fa3c605
Author: António Fernandes <antoniof gnome org>
Date: Sun Jan 2 12:41:05 2022 +0000
properties-window: Set Image pixel size
GtkImage no longer sets an icon size on construction.
Set a pixel size which matches the intrinsic size of the paintable.
src/nautilus-properties-window.c | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 19307528f..64b79c332 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -456,6 +456,7 @@ update_properties_window_icon (NautilusPropertiesWindow *self)
{
g_autoptr (GdkPaintable) paintable = NULL;
g_autofree char *name = NULL;
+ gint pixel_size;
get_image_for_properties_window (self, &name, &paintable);
@@ -464,8 +465,13 @@ update_properties_window_icon (NautilusPropertiesWindow *self)
gtk_window_set_icon_name (GTK_WINDOW (self), name);
}
+ pixel_size = MAX (gdk_paintable_get_intrinsic_width (paintable),
+ gdk_paintable_get_intrinsic_width (paintable));
+
gtk_image_set_from_paintable (GTK_IMAGE (self->icon_image), paintable);
gtk_image_set_from_paintable (GTK_IMAGE (self->icon_button_image), paintable);
+ gtk_image_set_pixel_size (GTK_IMAGE (self->icon_image), pixel_size);
+ gtk_image_set_pixel_size (GTK_IMAGE (self->icon_button_image), pixel_size);
}
#if 0 && NAUTILUS_DND_NEEDS_GTK4_REIMPLEMENTATION
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]