Hi all,
I’m developing a GTK app, built as a Flatpak using GNOME Nightly.
In my UI, I use a custom button-like widget that contains a child Gtk.Image. As the window is resized, the widget and the image should scale dynamically. To handle this, I’ve overridden the size_allocate
function to:
- Calculate the new size for the image
- Call
size_allocate()
on the image to resize it - Call
set_pixel_size()
on the image to scale it
This setup had been working fine. However, starting today, I noticed that the image now appears very blurry. I suspect this change is due to a recent update in GTK brought in through GNOME Nightly.
I could not pinpoint the exact commit but I found this GTK 4.19.2 NEWS update which seems related to the behavior I’m seeing:
* GtkImage:
- Change the sizing behavior for paintables. Stop scaling them up
So my questions are:
- What’s the correct approach now for dynamically scaling images with Gtk.Image?
- Can I still achieve this effect using Gtk.Image, or do I have to resort to a lower-level API like Gdk.Texture or Gdk.Paintable directly?