changeset 4927:e2101806cb45

7130360: [macosx] Packed JInternalFrame invisible on Aqua L&F Reviewed-by: anthony
author alexp
date Wed, 01 Feb 2012 15:38:51 +0400
parents d42b52b9b7f2
children 8f038c7954a4
files src/macosx/classes/com/apple/laf/AquaInternalFrameUI.java
diffstat 1 files changed, 9 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/macosx/classes/com/apple/laf/AquaInternalFrameUI.java	Wed Feb 01 15:32:29 2012 +0400
+++ b/src/macosx/classes/com/apple/laf/AquaInternalFrameUI.java	Wed Feb 01 15:38:51 2012 +0400
@@ -256,19 +256,16 @@
         return map;
     }
 
-    public Dimension minimumLayoutSize(final Container c) {
-        // The minimum size of the internal frame only takes into account the
-        // title pane since you are allowed to resize the frames to the point
-        // where just the title pane is visible.
-        Dimension result = new Dimension();
-        if (getNorthPane() != null) {
-            result = new Dimension(getNorthPane().getMinimumSize());
+    public Dimension getPreferredSize(JComponent x) {
+        Dimension preferredSize = super.getMinimumSize(x);
+        Dimension minimumSize = frame.getMinimumSize();
+        if (preferredSize.width < minimumSize.width) {
+            preferredSize.width = minimumSize.width;
         }
-        final Insets i = frame.getInsets();
-        result.width += i.left + i.right;
-        result.height += i.top + i.bottom;
-
-        return result;
+        if (preferredSize.height < minimumSize.height) {
+            preferredSize.height = minimumSize.height;
+        }
+        return preferredSize;
     }
 
     public void setNorthPane(final JComponent c) {