Fix c213218b66: Don't highlight selected dropdown item if it has a click result.

This is used by toggles and buttons within the dropdown item, and using those should not cause the row to look selected.
This commit is contained in:
Peter Nelson
2025-12-24 19:41:20 +00:00
committed by dP
parent 4bb6236410
commit d81fa6f9a4

View File

@@ -288,7 +288,7 @@ struct DropdownWindow : Window {
if (y > -item_height) { if (y > -item_height) {
Rect full = ir.Translate(0, y).WithHeight(item_height); Rect full = ir.Translate(0, y).WithHeight(item_height);
bool selected = (this->selected_result == item->result) && item->Selectable(); bool selected = (this->selected_result == item->result) && item->Selectable() && this->selected_click_result < 0;
if (selected) GfxFillRect(full, PC_BLACK); if (selected) GfxFillRect(full, PC_BLACK);
item->Draw(full, full.Shrink(WidgetDimensions::scaled.dropdowntext, RectPadding::zero), selected, selected ? this->selected_click_result : -1, colour); item->Draw(full, full.Shrink(WidgetDimensions::scaled.dropdowntext, RectPadding::zero), selected, selected ? this->selected_click_result : -1, colour);