GTK 3: How can I use custom png icons without losing quality?

Hello, I noticed if I use png icon(100x100px) in entry, it is compressed without loss of quality, but if I add png as an image with a decrease in size, it greatly loses quality. I tried a lot of different functions, including where GDK_INTERP_HYPER(gdk_pixbuf_scale_simple) is used, the quality did not change when the methods changed. How can I achieve the same quality in a button as in entry?


How you can see, in entry(search) is a high-quality image, the buttons on top have lost quality.

Maybe someone will come in handy, I solved the problem by changing the icontheme paths.

const gchar *paths[] = {“your_path_one”, “your_path_two”};
gtk_icon_theme_set_search_path(gtk_icon_theme_get_default(), paths, 1);

Indicated to look for an icons in the necessary folder.
Then, even through the glade, you can access the icons

Icon Name = File Name (icon-name = icon-name.png).

This solved the quality problem.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.