From d6027cd896be6c2ca724401688ab4b6f293ba657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20M=C3=A4ckel?= Date: Mon, 29 Aug 2022 07:49:28 +0200 Subject: [PATCH] Fixed prompt text displayed twice in ComboBox. (#349) Closes #340. --- CHANGELOG.md | 1 + .../main/kotlin/tools/aqua/bgw/builder/UINodeBuilder.kt | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f36f5e1e25..1573aaf1b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ All notable changes to this project will be documented in this file. ### Fixed - Wrong main class in build config of bgw-net protocol client +- Prompt text displayed twice in ComboBox. ## [0.7.2] - 14.08.2022 diff --git a/bgw-gui/src/main/kotlin/tools/aqua/bgw/builder/UINodeBuilder.kt b/bgw-gui/src/main/kotlin/tools/aqua/bgw/builder/UINodeBuilder.kt index 1a79541792..6ddc80ea50 100644 --- a/bgw-gui/src/main/kotlin/tools/aqua/bgw/builder/UINodeBuilder.kt +++ b/bgw-gui/src/main/kotlin/tools/aqua/bgw/builder/UINodeBuilder.kt @@ -261,9 +261,12 @@ object UINodeBuilder { object : ListCell() { override fun updateItem(item: T, empty: Boolean) { super.updateItem(item, empty) - this.style = comboBox.font.toFXFontCSS() - this.textFill = comboBox.font.color.toFXColor() - if (!empty) { + + if (empty) { + this.textFill = Color(0F, 0F, 0F, 0F).toFXColor() + } else { + this.style = comboBox.font.toFXFontCSS() + this.textFill = comboBox.font.color.toFXColor() this.text = comboBox.formatFunction?.invoke(item) ?: item.toString() } }