KMessageWidget: use darker red color when close button is visible
ClosedPublic

Authored by elvisangelaccio on Nov 18 2016, 2:23 PM.

Details

Summary

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.

Test Plan

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
elvisangelaccio retitled this revision from to KMessageWidget: use darker red color when close button is visible.
elvisangelaccio updated this object.
elvisangelaccio edited the test plan for this revision. (Show Details)

Before: close button is barely visible in the red panel.

After: close button is now distinguishable from the red panel:

elvisangelaccio added projects: Frameworks, VDG.
elvisangelaccio changed the visibility from "elvisangelaccio (Elvis Angelaccio)" to "Public (No Login Required)".
elvisangelaccio changed the edit policy from "elvisangelaccio (Elvis Angelaccio)" to "All Users".
cfeck edited edge metadata.EditedNov 18 2016, 6:54 PM

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.

elvisangelaccio edited edge metadata.

Always use the darker color

In D3418#63820, @cfeck wrote:

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.

In D3418#63900, @cfeck wrote:

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 :)

Remove no longer needed call, now we always use the darker color

In D3418#63900, @cfeck wrote:

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...

cfeck accepted this revision.Nov 20 2016, 3:58 AM
cfeck edited edge metadata.

If VDG is fine with the contrast, commit.

This revision is now accepted and ready to land.Nov 20 2016, 3:58 AM

Before: close button is barely visible in the red panel.

After: close button is now distinguishable from the red panel:

@htietze Ping?

ltoscano edited edge metadata.Nov 30 2016, 11:09 PM
ltoscano set the repository for this revision to R236 KWidgetsAddons.

Before: close button is barely visible in the red panel.

After: close button is now distinguishable from the red panel:

@htietze Ping?

Ping anyone from VDG?

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)

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)

Thanks. Unfortunately I could not find an easy way to change the icon color...