Check the icon's type before using the icon_alpha theme property.
Custom icons are indeed an issue. Matcaps and such use ICON_TYPE_BUFFER, other previews like material previews use ICON_TYPE_PREVIEW. However ICON_TYPE_PREVIEW is also used for custom icons (should maybe be mentioned in a comment at its definition). So we can't just rely on that currently.
I think there could just be a bool use_theme_icon_alpha passed to icon_create() and stored in Icon. That gives better control and seems generally a bit nicer, since the option is controlled at a higher level.
Another issue is that custom icons are used for both, regular icons, as well as custom previews. So we'd need the information on how the icon is used to know if we should apply the alpha. For now I'd say just always apply the alpha for custom icons. If needed we can let the Python API have more control.
Event icons may be mixed with other icons, so we should apply alpha for them too, otherwise:
Note that this is already an issue in master, but that's separate. So I'd just add ICON_TYPE_EVENT here.
That wouldn't be the end of the world... but I actually like that feature...
I got a quite dark custom theme and (depending on the mood hehehe) sometimes I feel like the icons are in the way.... so be able to adjust the opacity of all the icons at same time with just one slider was kinda neat....
I'm not particularly attached to keeping the feature, it's not important. It's still convenient somewhat, so we might as well keep it and not break API/theme compatibility?
However ICON_TYPE_PREVIEW is also used for custom icons (should maybe be mentioned in a comment at its definition). So we can't just rely on that currently.
I'm not sure how deep this goes, but using a different ICON_TYPE for custom icons would be good then, since using ICON_TYPE_PREVIEW makes little sense.