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:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user