Fix: Make dropdowns self-close when losing focus.
This commit is contained in:
@@ -199,6 +199,11 @@ struct DropdownWindow : Window {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnFocusLost() override
|
||||||
|
{
|
||||||
|
this->Close();
|
||||||
|
}
|
||||||
|
|
||||||
Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override
|
Point OnInitialPosition(int16 sm_width, int16 sm_height, int window_number) override
|
||||||
{
|
{
|
||||||
return this->position;
|
return this->position;
|
||||||
|
@@ -2331,7 +2331,6 @@ static void StartWindowDrag(Window *w)
|
|||||||
_drag_delta.y = w->top - _cursor.pos.y;
|
_drag_delta.y = w->top - _cursor.pos.y;
|
||||||
|
|
||||||
BringWindowToFront(w);
|
BringWindowToFront(w);
|
||||||
CloseWindowById(WC_DROPDOWN_MENU, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2349,7 +2348,6 @@ static void StartWindowSizing(Window *w, bool to_left)
|
|||||||
_drag_delta.y = _cursor.pos.y;
|
_drag_delta.y = _cursor.pos.y;
|
||||||
|
|
||||||
BringWindowToFront(w);
|
BringWindowToFront(w);
|
||||||
CloseWindowById(WC_DROPDOWN_MENU, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user