Don't take the value of "mask" parameter of wxImageList constructor too prescriptively, it predates support for alpha in wxWidgets by many years and was never meant to actually suppress using it. Instead, do the best thing we can in all cases, i.e. use alpha if it's specified and supported and use mask otherwise. But only create the mask from light grey colour if we have nothing else if "mask" is true in wxImageList constructor, as this is a potentially destructive action that must not be performed if the user has explicitly decided to set this parameter to false. Incidentally fix handling of alpha with comctl32.dll v5 (which is used in the absence of any manifest) by converting it to a mask in this case: this is not ideal, but better than just using black background as it happened before, and restores pre-3.1.5 behaviour. Also simplify the generic version which just has to create the default mask if necessary and doesn't have to do anything at all in all the other cases. Note that these changes required relaxing some of the existing unit tests as wxMSW implementation now can add alpha channel to the bitmaps that didn't have it -- but this is a more useful behaviour, and so it makes more sense to adapt the tests to it rather than doing a less useful thing just to conform to the tests. This commit is best viewed with git --color-moved --color-moved-ws=ignore-all-spac options. Closes #22349.
23 KiB
23 KiB