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

Make the padding between text and arrow adjustable in ComboBox

XMLWordPrintable

      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

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

              Created:
              Updated:
              Imported: