jeudi 1 janvier 2015

JavaFX ComboBox styling (disabled psuedo-class)


Vote count:

1




I have this (simple) combination of fxml/css and java. The combobox in question (operationSelector) is indeed disabled, but it's opacity is 0.4 (the default for disabled nodes instead of 1.0). Printing this.operationSelector.getStyleClass() shows that the singleton-combo-box class is indeed part of its style class. I tried disabling all style classes but singleton-combo-box and STILL the opacity is 0.4 when disabled. Does anything obviously wrong jump out?


In FXML:



<ComboBox fx:id="operationSelector" styleClass="singleton-combo-box" GridPane.columnIndex="1" GridPane.rowIndex="1" />


In CSS:



.singleton-combo-box:disabled {
-fx-opacity: 1.0;
}
.singleton-combo-box .list-cell:disabled {
-fx-opacity: 1.0;
-fx-text-fill: black;
}


In Java:



@FXML private ComboBox<String> operationSelector;

@FXML
private void initialize()
{
this.operationSelector.setDisable(true);
}


Here is the result:


http://ift.tt/1CWfhXM



asked 1 min ago







JavaFX ComboBox styling (disabled psuedo-class)

Aucun commentaire:

Enregistrer un commentaire