Closed afalkenhahn closed 8 years ago
Can you provide a suitable algorithm for this purpose? The current implementation is the original one done by Alfonso Ranieri. But I doubt that a specific algorithm can produce a better result for arbitrary images. Specially designed ghosted images will always look far better than algorithmically computed ones. All an algorithm can do is to apply a specific generic effect. But there is no guarantee that this effect produces perfectly matching ghosted images for arbitrary normal images. If you want a perfect match then you need to provide all images.
If you have the ARGB data, it's really simple to make disabled images. You could just mix 50% white into the data, or 50% black or convert the color channels to grey and then darken it a little. Here is a case study quickly made in Hollywood:
I think each of the three looks better than the current algorithm. Of course, there is no perfect algorithm, e.g. the algorithms based on blackening won't look significantly different from toolbar images which are already mostly grey while the whitening one won't look so good on images which are mostly white.
There is no perfect generic solution so people who really care should use custom images for the disabled state. Still, I think that the current algorithm is really ugly and should use an enhancement, e.g. one from the ones presented above or your custom idea...
By the way: Why not just use MUI's inbuilt graying algorithm? This would probably be the best solution because it's consistent with MUI. When disabling a button that has an image in it, MUI also uses some sort of graying out algorithm. This algorithm could be used by TheBar for disabling images as well.
MUI just draws a grey rectangle with transparency across the complete rectangular area. This is definitely something different to the current approach where the manipulation is applied to visible pixels only. But now that I come to think more about this the latter wouldn't be a real problem, because an additional grey shade has no influence on fully transparent pixels. The only problem are colormapped screens, as this effect works on truecolor screens only.
Test binaries with new disabled/ghosting style. Please keep in mind that you might need to adjust your settings for the disabled button mode to "Grey" instead of "Shape", otherwise you won't see any difference. Please let me know whether this fullfils your expectations of "not ugly".
thebar_ghost_mos.zip thebar_ghost_os3.zip thebar_ghost_os4.zip
Yes, this looks much better. Problem solved, thanks!
When creating a toolbar which doesn't specify separate images for disabled buttons, the standard "graying out" algorithm used by TheBar doesn't look so attractive. See here:
IMHO it would be nicer to use a different algorithm that converts the icon to grayscale or something like that. The current algorithm doesn't look so nice for alphachannel images. It was probably designed for palette based graphics.