changeset 5499:288eb8869c9c

RT-33183 [MenuButton, SplitMenuButton] minWidth is too large Reviewed-by : jgiles
author Martin Sladecek <martin.sladecek@oracle.com>
date Wed, 23 Oct 2013 09:51:45 +0200
parents 0c90b4063ae7
children 6ac26131bcaf
files modules/controls/src/main/java/com/sun/javafx/scene/control/skin/MenuButtonSkinBase.java
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/MenuButtonSkinBase.java	Wed Oct 23 08:36:59 2013 +0100
+++ b/modules/controls/src/main/java/com/sun/javafx/scene/control/skin/MenuButtonSkinBase.java	Wed Oct 23 09:51:45 2013 +0200
@@ -248,11 +248,16 @@
      **************************************************************************/
     
     @Override protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) {
-        return computePrefWidth(height, topInset, rightInset, bottomInset, leftInset);
+        return leftInset
+                + label.minWidth(height)
+                + snapSize(arrowButton.minWidth(height))
+                + rightInset;
     }
-    
+
     @Override protected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) {
-        return computePrefHeight(width, topInset, rightInset, bottomInset, leftInset);
+        return topInset
+                + Math.max(label.minHeight(width), snapSize(arrowButton.minHeight(-1)))
+                + bottomInset;
     }
 
     @Override protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) {