Re: gtk_icon_theme_load_icon and GDK_SCALE=2 results in blurry icon




It looks like GDK_SCALE makes GtkIconView scale its icons (the pixbufs).

Glib::RefPtr<Gdk::Pixbuf> hd_icon = default_icon_theme->load_icon("gtk-harddisk", 64, 2, 
Gtk::IconLookupFlags(0));
This makes a pixbuf of size 128 (the filename points to 128-size png).

However, when this pixbuf is set on a GtkIconView, it's scaled by it,
making the size 256.

Basically, I need a method of disabling GtkIconView's scaling of icons.

Thanks,
Alexander


On Tue, 2017-10-03 at 19:43 +0400, Alexander Shaduri wrote:
Hi Stefan,

On Tue, 2017-10-03 at 16:59 +0200, Stefan Salewski wrote:

Have you tried

https://developer.gnome.org/gtk3/stable/GtkIconTheme.html#gtk-icon-theme-load-icon-for-scale

Yes I have tried gtk_icon_theme_lookup_icon_for_scale().
Passing size=64 and scale=2 to this function results in a blurry icon
of size 256. It seems the icon is scaled twice - once by "scale" and
once
more by GDK_SCALE=2.
Passing scale=1 gets me a blurry 128-size icon.


There you will find a reference to

https://developer.gnome.org/gtk3/stable/GtkIconTheme.html#gtk-icon-theme-load-icon-for-scale

where notes about displays with high pixel densities exists.

I guess you meant gtk_icon_theme_lookup_icon(). It just says to use
gtk_icon_theme_lookup_icon_for_scale(), which gets me a blurry icon.

Thanks,
Alexander


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]