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

Make the padding between text and arrow adjustable in ComboBox

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 8u11
    • Fix Version/s: tbd
    • Component/s: javafx

      Description

      It seems to be impossible to reduce the distance between text and arrow of a ComboBox.

      If I use the css:

      .combo-box-base > *.arrow-button {
          -fx-padding: 0 0 0 0;
          -fx-background-color: pink, pink, pink, pink; <- just to make the button bound visible
      }
      the arrow button gets smaller but the ComboBox itself still have the same size, only increasing the gap between the arrow and text to compensate.

      If I do

      .combo-box > .list-cell {
          -fx-padding: 0 0 0 0;
          -fx-border-insets: 0 0 0 0;
      }
      The combo get a smaller height but the width remain fixed.

      Since all padding except the distance between the text and arrow can be reduced I recon this is an oversight/bug. To make a version of the ComboBox for where space is sparse this whitespace needs to be reduced.

      A screenshot is available here: http://stackoverflow.com/questions/24852429/making-a-smaller-javafx-combobox

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mgrev Mikael Grev
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported: