0

I´d like to reduce the padding to show my full text.

I have tried it, but doenst work.

.combo-box
{
    -fx-background-color: -color-gray;
    -fx-text-fill: -color-primary;
    -fx-cell-size: 2.5em; 
    -fx-font-family: 'Myriad Pro Light';
    -fx-font-size: 14pt;
    -fx-padding: 0 0 0 0;
}

enter image description here

Marckaraujo
  • 7,422
  • 11
  • 59
  • 97

2 Answers2

0

I tried your code and works for me. I don't think padding might be useful for you. Instead, you can change the font-size. If you use a small font-size you should see your text inside that button.

In this type of scenarios, you can use Scenic View to view graphics elements and see what the problem might be.

Hope it helps

FFdeveloper
  • 241
  • 3
  • 14
  • thx for trying it out. But I dont like to use a small font-size, it will not look good, I want to figure out how to change the padding of the label box. – Marckaraujo Apr 18 '17 at 14:40
  • I don't think changing padding could be a solution, as i said before. Maybe you have to use a greater width for the combobox if you don't want to change the font-size – FFdeveloper Apr 18 '17 at 18:09
0

I had to setup negative padding in .box:

.combo-box
{
    -fx-background-color: -color-gray;
    -fx-text-fill: -color-primary;
    -fx-cell-size: 2.5em; 
    -fx-font-family: 'Myriad Pro Light';
    -fx-font-size: 14pt;
    -fx-padding: -5 -5 -5 -15;
}

Also need to remove the padding from default modena.css inside .arrow-button

.combo-box-base > .arrow-button {
    -fx-background-radius: 0 3 3 0, 0 2 2 0, 0 1 1 0;
    -fx-padding: 0 0.833333em 0 0;
    -fx-background-color: transparent;
    -fx-alignment:center-left;
}
Marckaraujo
  • 7,422
  • 11
  • 59
  • 97