Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8127088

Combobox resize height in mouse over

XMLWordPrintable

      Video and class of demo.

      Issue is that the ComboBox button defaults to a 1px smaller height than it should, if it were to be consistent with other UI controls such as Button. Once the mouse hovers near the button, it recalculates its size and slightly jumps in size. The fix is to simply update a single constant value from the old default height to the new default height.

      diff --git a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxBaseSkin.java b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxBaseSkin.java
      --- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxBaseSkin.java
      +++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/ComboBoxBaseSkin.java
      @@ -158,7 +158,7 @@
               final Insets padding = getInsets();
       
               if (displayNode == null) {
      - final int DEFAULT_HEIGHT = 20;
      + final int DEFAULT_HEIGHT = 21;
                   final Insets arrowButtonPadding = arrowButton.getInsets();
                   double arrowHeight = arrowButtonPadding.getTop() + arrow.prefHeight(-1) + arrowButtonPadding.getBottom();
                   return padding.getTop() + Math.max(DEFAULT_HEIGHT, arrowHeight) + padding.getBottom();

        1. Gerador.java
          5 kB
        2. video.avi
          178 kB

            jgiles Jonathan Giles
            gstiwesjfx giovanni stiwes (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: