mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Fix arbitrator language selection prompt text
After selecting a language from the combobox, it would no longer display the prompt text and instead would be blank. As per the documentation https://docs.oracle.com/javase/10/docs/api/javafx/scene/control/ComboBoxBase.html#promptTextProperty: > Prompt text is not displayed in all circumstances, it is dependent > upon the subclasses of ComboBoxBase to clarify when promptText will be > shown. Therefore, use a custom buttonCell on the combo box to display the prompt text.
This commit is contained in:
parent
cb42942d86
commit
b1066d8fe1
@ -193,6 +193,17 @@ public class ArbitratorSelectionView extends ActivatableViewAndModel<GridPane, A
|
||||
|
||||
languageComboBox = FormBuilder.<String>addLabelComboBox(root, ++gridRow, "", 15).second;
|
||||
languageComboBox.setPromptText(Res.get("shared.addLanguage"));
|
||||
languageComboBox.setButtonCell(new ListCell<String>() {
|
||||
@Override
|
||||
protected void updateItem(final String item, boolean empty) {
|
||||
super.updateItem(item, empty) ;
|
||||
if (empty || item == null) {
|
||||
setText(Res.get("shared.addLanguage"));
|
||||
} else {
|
||||
setText(LanguageUtil.getDisplayName(item));
|
||||
}
|
||||
}
|
||||
});
|
||||
languageComboBox.setConverter(new StringConverter<String>() {
|
||||
@Override
|
||||
public String toString(String code) {
|
||||
|
Loading…
Reference in New Issue
Block a user