Re: gtk_icon_theme_load_icon and GDK_SCALE=2 results in blurry icon

2017-10-04 Thread Alexander Shaduri
Hi, On Tue, 2017-10-03 at 20:13 +0200, infirit wrote: > See bug 765167 [1] it has an example in python how you can still use a > surface in the GtkIconView.  You should be able to translate this pretty > easily to C/C++. > > ~infirit > > [1] https://bugzilla.gnome.org/show_bug.cgi?id=765167#c5.

Re: gtk_icon_theme_load_icon and GDK_SCALE=2 results in blurry icon

2017-10-03 Thread infirit
Op 10/03/2017 om 07:49 PM schreef Alexander Shaduri: > I'm at loss here, I guess this can be viewed as a bug in GtkIconView. It does not support surfaces directly it seems but there is a somewhat ugly workaround. See bug 765167 [1] it has an example in python how you can still use a surface in th

Re: gtk_icon_theme_load_icon and GDK_SCALE=2 results in blurry icon

2017-10-03 Thread Alexander Shaduri
Hi, On Tue, 2017-10-03 at 19:32 +0200, infirit wrote: > Op 10/03/2017 om 03:28 PM schreef Alexander Shaduri: > > > > I have a HiDPI Screen with DPI set to 192, GDK_SCALE=2 and GDK_DPI_SCALE=-1. > > > > I need to get an icon as a pixbuf for GtkIconView. > > Short answer, there is no way to do s

Re: gtk_icon_theme_load_icon and GDK_SCALE=2 results in blurry icon

2017-10-03 Thread infirit
Op 10/03/2017 om 03:28 PM schreef Alexander Shaduri: > I have a HiDPI Screen with DPI set to 192, GDK_SCALE=2 and GDK_DPI_SCALE=-1. > > I need to get an icon as a pixbuf for GtkIconView. Short answer, there is no way to do scaling properly with pixbufs. The only way I found to do this was setting

Re: gtk_icon_theme_load_icon and GDK_SCALE=2 results in blurry icon

2017-10-03 Thread Alexander Shaduri
It looks like GDK_SCALE makes GtkIconView scale its icons (the pixbufs). Glib::RefPtr 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

Re: gtk_icon_theme_load_icon and GDK_SCALE=2 results in blurry icon

2017-10-03 Thread LRN
On 10/3/2017 4:28 PM, Alexander Shaduri wrote: > > Now matter how I try, I simply cannot get a non-blurry icon. It seems that > GTK+ looks up an icon of size 64, then scales it to 128. I'd like for it to > get a 128-size icon directly. > > Specifying 128 as an argument results in a blurry icon of

Re: gtk_icon_theme_load_icon and GDK_SCALE=2 results in blurry icon

2017-10-03 Thread Alexander Shaduri
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

Re: gtk_icon_theme_load_icon and GDK_SCALE=2 results in blurry icon

2017-10-03 Thread Stefan Salewski
On Tue, 2017-10-03 at 17:28 +0400, Alexander Shaduri wrote: > I have a HiDPI Screen I also. 27 inch 4k display. I started also with scale of 2 to avoid tiny objects, but now I use scale=1 with larger fonts and I use some custom CSS to make vertical scrollbars a bit larger. Firefox can scale webpag

gtk_icon_theme_load_icon and GDK_SCALE=2 results in blurry icon

2017-10-03 Thread Alexander Shaduri
Hi, I have a HiDPI Screen with DPI set to 192, GDK_SCALE=2 and GDK_DPI_SCALE=-1. I need to get an icon as a pixbuf for GtkIconView. This is the code in gtkmm: Glib::RefPtr default_icon_theme = Gtk::IconTheme::get_default(); Glib::RefPtr icon = default_icon_theme->load_icon("drive-harddisk", 64