Currently the close button is barely visible when type is Error and the background color is red. See screenshots and discussion in bug 357210.
This patch sets a slightly darker background color, and only when the close button is visible.
Details
The close button is actually distinguishable from the panel. If the close button is hidden, the unaltered red color from the Breeze color scheme is used instead.
Diff Detail
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Before: close button is barely visible in the red panel.
After: close button is now distinguishable from the red panel:
No need for the timer stuff. Use the darker color regardless of button presence.
If you really want to make your hands dirty, check if it is possible to render the close icon using the text color.
Actually I added the timer because otherwise the Information type gets a lighter blue color. I suspect that q->palette() is different before/after the Show event. I don't like it either
About the icon color, I briefly tried to mess with the CSS, but I gave up quickly :p
Actually I added the timer because otherwise the Information type gets a lighter blue color. I suspect that q->palette() is different before/after the Show event. I don't like it either
If the palette changes, you can catch this via QEvent::ApplicationPaletteChange and QEvent::PaletteChange events.
Turns out the palette doesn't change. The problem was that the palette is set to the Active color group (what we want) only when the widget is visible *and* isActiveWindow() is true. So the Show event was not enough, we need the WindowActivate event instead :)
Actually, we don't even need this... The patch now always sets the darker color, so there is nothing to update to begin with...
Patch is now one line, which means that D3417 is not really necessary and this could be applied on master...
I'm fine with the contrast. Is it possible to use the icon in the text color (gray) if not possible darker red would be fine. (thanks for the patch I always saw this issue)