Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.

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

Open
Stephane-D opened this issue Sep 12, 2012 · 3 comments
Open

Comments

@Stephane-D
Copy link

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
Copy link

shemnon commented Sep 12, 2012

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

@Stephane-D
Copy link
Author

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
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants