GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git
Dropdown: menu-button mode drops the selected-row marker
A custom_display_text dropdown's rows are commands, not a selection —
`selected` there is just "last fired", which the blue row color was
presenting as state. Selection dropdowns keep the marker.
Co-Authored-By: Claude <[email protected]>
src/widget/input/dropdown.rs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/widget/input/dropdown.rs b/src/widget/input/dropdown.rs
index cb9c096..2607396 100644
--- a/src/widget/input/dropdown.rs
+++ b/src/widget/input/dropdown.rs
@@ -1040,9 +1040,11 @@ impl Paint for Dropdown {
continue;
}
+ // Menu-button mode (custom_display_text) has no "current" option —
+ // its rows are commands, so none reads as selected.
let text_color = if self.hovered_item == Some(idx) {
[0xff, 0xff, 0xff]
- } else if self.selected == idx {
+ } else if self.selected == idx && self.custom_display_text.is_none() {
[0x3a, 0x9a, 0xff]
} else {
[0xcc, 0xcc, 0xd4]