libgimpwidgets: fix default icon.

gtk_window_set_default_icon_name() apparently isn't able to properly
fallback to symbolic or non-symbolic variant. So let's test both.
There is also gtk_window_set_icon_list() but it takes a list of pixbuf,
so I really doubt it is the best solution either. The proposed solution
is working ok for now, even though I feel it is again a bit hackish.
This commit is contained in:
Jehan 2018-05-30 23:47:08 +02:00
parent ee6eb194c5
commit 0ac3cd01f0
1 changed files with 8 additions and 1 deletions

View File

@ -65,6 +65,8 @@ gimp_widgets_init (GimpHelpFunc standard_help_func,
GimpGetColorFunc get_background_func,
GimpEnsureModulesFunc ensure_modules_func)
{
GtkIconTheme *icon_theme;
g_return_if_fail (standard_help_func != NULL);
if (gimp_widgets_initialized)
@ -79,7 +81,12 @@ gimp_widgets_init (GimpHelpFunc standard_help_func,
gimp_icons_init ();
gtk_window_set_default_icon_name (GIMP_ICON_WILBER);
icon_theme = gtk_icon_theme_get_for_screen (gdk_screen_get_default ());
if (gtk_icon_theme_has_icon (icon_theme, GIMP_ICON_WILBER "-symbolic"))
gtk_window_set_default_icon_name (GIMP_ICON_WILBER "-symbolic");
else
gtk_window_set_default_icon_name (GIMP_ICON_WILBER);
gimp_widgets_init_foreign_enums ();