Insubstantial / insubstantial

Swing look-and-feel library and assorted widgets
193 stars 57 forks source link

Incorrect coloration of JTextField in the taskbar (flamingo) with Cerulean skin #106

Open Stephane-D opened 11 years ago

Stephane-D commented 11 years ago

We use Substance and Flamingo in our application. When we try to add an JTextField component in the taskbar we observe a weird coloration and only for the Cerulean skin (all others are corrects).

When the frame is focused color is correct (even if the colored background seems a bit strange, but, why not...) But when the frame lost focus, we expect the background color of the JTextfield to be a bit lighter as the rest of the taskbar component but instead it turns darker which really look "unnatural".

Here are pictures.

FOCUS : focus

NO FOCUS : focus

I know this is a really minor issue but i think it's just a typo in the Cerulean skin definition which should be easy to fix (Cerulean is the default skin we use for our application).

enwired commented 11 years ago

I avoid using the Cerulean skin because the license which is in that source code confuses me. Is it ok to use/modify that code?

Stephane-D commented 11 years ago

We can have different license depending used skin ? I though they all were BSD as Substance is based on.

enwired commented 11 years ago

If you look in the source code, the header for that skin contains a different license from the header for, "Moderate" for example. "Moderate" used to be considered one of the "supported" skins, but "Cerulean" was not. (Of course, none of them are "supported" by the author anymore.)

I don't know what the implications of the license used on the non-supported skins is. The skins are all just minor variations on ways of combining features from the rest of the substance code, so it is hard to understand why there would be restrictions on some and not on others.

Stephane-D commented 11 years ago

Indeed, skins are just color schemes and others minors parameters.. i will have a look on the Cerulean license code but i do not worry much as our application is free and open source.

shemnon commented 11 years ago

license was an oversight, it is conformant to the main license now.

shemnon commented 11 years ago

It's deeper than a typo. The support I put in for window activation color never extended to the task panel.

Basically you need to change the decoration area when the window changes it's decoration area when the window no longer becomes active. Change it to org.pushingpixels.substance.api.DecorationAreaType#PRIMARY_TITLE_PANE_INACTIVE when the frame is not active, and then back to the default when it is.

Internally we punted and put

getRootPane().putClientProperty(SubstanceLookAndFeel.WINDOW_AUTO_DEACTIVATE, false);

into the pane with the ribbon, so it always appears with the active coloring.

Stephane-D commented 11 years ago

You said the Ribbon component do not receive inactive decoration and indeed the ribbon tabs do not change but it looks like the taskbar receive it as it actually colors differently when it lost focus... is there any specific decoration for that ? I guess there is as the JTextField does not have any blue background in usual container. I will try to dig a bit to find out this minor issue.

shemnon commented 11 years ago

The active/inactive coloring is driven by the org.pushingpixels.substance.api.DecorationAreaType.PRIMARY_TITLE_PANE and org.pushingpixels.substance.api.DecorationAreaType.PRIMARY_TITLE_PANE_INACTIVE decorations on the JRootPane, and only the JRootPane. The coloration changes on the task bar are because the color is painted with an alpha channel, it shows through some of what is painted underneath it.

Stephane-D commented 11 years ago

Thanks for providing further details about that, I will see how i can tweak that a bit to have better looking in our specific case :)