Skip to content

GtkIconTheme: choose reasonable size to fix invisible icon

Alynx Zhou requested to merge AlynxZhou/gtk:gtk-3-24 into gtk-3-24

When icon name is loaded inside a GtkImage that pixel_size is -1 and icon_size is GTK_ICON_SIZE_INVALID, 0 will be desired icon size. And for scalable icons, if desired icon size is smaller than theme's MinSize, GTK will recalculate a scale to downscale icon to MinSize. However, when user set those arguments, they don't really want a invisible icon, they want to load the theme's default size. This commit skips scale recalculating when desired icon size is 0 to fix it.

Fixes #4488

PS The reason why I said user does not really want invisible icon is from gnome-control-center!985 (merged), they set pixel_size to -1 and icon_size to GTK_ICON_SIZE_INVALID, to let GTK choose proper size for non-square logos. I'd like to let the original author of this MR explain their usage, but he misunderstood me and just locked the SR, sad.

Merge request reports