1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-19 10:22:39 +01:00

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 Peter Nelson
parent 48bc08dbfb
commit c7f6971729

View File

@@ -283,7 +283,7 @@ struct DropdownWindow : Window {
if (y > -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);
item->Draw(full, full.Shrink(WidgetDimensions::scaled.dropdowntext, RectPadding::zero), selected, selected ? this->selected_click_result : -1, colour);