Insubstantial / insubstantial

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

JInternalFrame opaque property forced to true with no rounded corners. #90

Open Stephane-D opened 11 years ago

Stephane-D commented 11 years ago

I can understand the opaque property need to be set to false with "Rounded Corners" but i don't see why we need the contrary : set it to true when corners are not rounded. In the SubstanceInternalFrameUI.java file, we can found the following code at line 149 (installListeners) :

...
else if (SubstanceLookAndFeel.WINDOW_ROUNDED_CORNERS.equals(propertyName)
                    || JInternalFrame.IS_MAXIMUM_PROPERTY.equals(propertyName)) 
            {
                frame.setOpaque(!SubstanceCoreUtilities.isRoundedCorners(frame));
            }

where i expect something like :

else if (SubstanceLookAndFeel.WINDOW_ROUNDED_CORNERS.equals(propertyName)
                    || JInternalFrame.IS_MAXIMUM_PROPERTY.equals(propertyName)) 
            {
                if (SubstanceCoreUtilities.isRoundedCorners(frame))
                    frame.setOpaque(false);
            }

This way we can have our own InternalFrame with some derived custom transparent paint. Of course i could override the isOpaque() and force to return false but i don't find that really elegant.

By the way, you did a very nice job on the library, i just upgraded to the last version and it fixed many annoying repaint bugs we had in our application. Also the integration of the system menu in frame is very welcome, we had to patch the library before and now the support is native. Thanks again for your awesome work :)

shemnon commented 11 years ago

Good point. I am not playing nicely with the opaque property. Changes will be incoming today or tonight.

Stephane-D commented 11 years ago

Wow ! flash reply ! Thanks :) I edited my message to make the issue a bit more precise and also to congratulate you about your awesome work ;).

Stephane-D commented 11 years ago

I think the problem was due to your wrong #90 fix, you used :

if (!SubstanceCoreUtilities.isRoundedCorners(frame)) {
    frame.setOpaque(false);
}

Instead of :

if (SubstanceCoreUtilities.isRoundedCorners(frame)) {
    frame.setOpaque(false);
}

Here is the original code :

frame.setOpaque(!SubstanceCoreUtilities.isRoundedCorners(frame))