From b1066d8fe112b24a3b0ebc8d4cf2c33df536a92c Mon Sep 17 00:00:00 2001 From: Devin Bileck <603793+devinbileck@users.noreply.github.com> Date: Fri, 12 Oct 2018 23:45:49 -0700 Subject: [PATCH] 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. --- .../arbitratorselection/ArbitratorSelectionView.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/desktop/src/main/java/bisq/desktop/main/account/content/arbitratorselection/ArbitratorSelectionView.java b/desktop/src/main/java/bisq/desktop/main/account/content/arbitratorselection/ArbitratorSelectionView.java index 7fa8c29f375..4b75a2fe763 100644 --- a/desktop/src/main/java/bisq/desktop/main/account/content/arbitratorselection/ArbitratorSelectionView.java +++ b/desktop/src/main/java/bisq/desktop/main/account/content/arbitratorselection/ArbitratorSelectionView.java @@ -193,6 +193,17 @@ public void updateItem(final String item, boolean empty) { languageComboBox = FormBuilder.addLabelComboBox(root, ++gridRow, "", 15).second; languageComboBox.setPromptText(Res.get("shared.addLanguage")); + languageComboBox.setButtonCell(new ListCell() { + @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() { @Override public String toString(String code) {