git.lucas.co / cce-ui
GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git

commitdd9f7385324abc2e5b20e526c513c2d396293bdb
parent4a0f1f91df
authorLucas Galante <[email protected]>
date2026-08-21 12:06
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]