1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-30 09:59:10 +00:00

Fix: Make dropdowns self-close when losing focus.

This commit is contained in:
2023-06-03 13:19:59 +01:00
committed by Loïc Guilloux
parent c3815359f1
commit 2d8d9c49c4
2 changed files with 5 additions and 2 deletions

View File

@@ -203,6 +203,11 @@ struct DropdownWindow : Window {
}
}
void OnFocusLost() override
{
this->Close();
}
Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override
{
return this->position;

View File

@@ -2321,7 +2321,6 @@ static void StartWindowDrag(Window *w)
_drag_delta.y = w->top - _cursor.pos.y;
BringWindowToFront(w);
CloseWindowById(WC_DROPDOWN_MENU, 0);
}
/**
@@ -2339,7 +2338,6 @@ static void StartWindowSizing(Window *w, bool to_left)
_drag_delta.y = _cursor.pos.y;
BringWindowToFront(w);
CloseWindowById(WC_DROPDOWN_MENU, 0);
}
/**