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

Combobox resize height in mouse over

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: fx2.1
    • Fix Version/s: fx2.1
    • Component/s: javafx
    • Environment:

      javafx2.1b15

      Description

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

        Attachments

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

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:
              Imported: