Insubstantial / insubstantial

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

Rounded corners feature makes part of the frame invisible on linux #72

Closed nroduit closed 11 years ago

nroduit commented 12 years ago

Rounded corners is activated by default. On Linux, when maximizing a window only the previous size is visible and on Mac it does not seem to have any effect.

It is a cool feature, but it is only for Windows and for a Java version up to 1.6.0_10. In addition this feature uses AWTUtilities which is not in the Java API (see http://stackoverflow.com/questions/1416869/how-to-distribute-awtutilities). Would be more reasonable to not activate this feature by default?

shemnon commented 12 years ago

The AWT utilities call will be migrated to an API call when Java6 support is dropped.

As for disabling it on linux and mac by default, do you have any OS sniffing code you could push?

On Sat, Apr 14, 2012 at 6:17 AM, Nicolas Roduit < reply@reply.github.com

wrote:

Rounded corners is activated by default. On Linux, when maximizing a window only the previous size is visible and on Mac it does not seem to have any effect.

It is a cool feature, but it is only for Windows and for a Java version up to 1.6.0_10. In addition this feature uses AWTUtilities which is not in the Java API (see http://stackoverflow.com/questions/1416869/how-to-distribute-awtutilities). Would be more reasonable to not activate this feature by default?


Reply to this email directly or view it on GitHub: https://github.com/Insubstantial/insubstantial/issues/72


"But you didn't." - Jim Halpert, The Office S05E23

nroduit commented 12 years ago

I will add at the end of the method org.pushingpixels.substance.api.SubstanceLookAndFeel.initialize(): if (!LookUtils.IS_OS_WINDOWS || System.getProperty("java.version").compareTo("1.6.0_10") < 0) { UIManager.put(WINDOW_ROUNDED_CORNERS, Boolean.FALSE); }

The compare method won't work with beta version of JVM, but it is not critical.

Thanks, Nicolas

nroduit commented 11 years ago

Here is a patch:

diff --git a/substance/src/main/java/org/pushingpixels/substance/api/SubstanceLookAndFeel.java b/substance/src/main/java/org/pushingpixels/substance/api/SubstanceLookAndFeel.java index 2b5b018..52b5f81 100755 --- a/substance/src/main/java/org/pushingpixels/substance/api/SubstanceLookAndFeel.java +++ b/substance/src/main/java/org/pushingpixels/substance/api/SubstanceLookAndFeel.java @@ -45,6 +45,7 @@ import org.pushingpixels.lafwidget.LafWidgetRepository; import org.pushingpixels.lafwidget.animation.AnimationConfigurationManager; import org.pushingpixels.lafwidget.animation.AnimationFacet; +import org.pushingpixels.lafwidget.utils.LookUtils; import org.pushingpixels.substance.api.SubstanceConstants.MenuGutterFillKind; import org.pushingpixels.substance.api.SubstanceConstants.SubstanceWidgetType; import org.pushingpixels.substance.api.combo.ComboPopupPrototypeCallback; @@ -1765,6 +1766,11 @@ .getCurrentKeyboardFocusManager(); this.currentKeyboardFocusManager .addPropertyChangeListener(this.focusOwnerChangeListener);

shemnon commented 11 years ago

The github messageing API really muddled up the patch. Could you do a pull request?

disrvptor commented 11 years ago

It's probably better/safer to code this

System.getProperty("java.version").compareTo("1.6.0_10")

as

"1.6.0_10".compareTo(System.getProperty("java.version"))

and then make sure the comparison to 0 is correct and includes 0. Just in case somehow the java.version property gets set to null.

nroduit commented 11 years ago

Yes, you're right. However, we can consider it is a mandatory property. There are other places in Substance that a null java.version will throw NullPointerException.