| 123 | } |
| 124 | |
| 125 | void Close([[maybe_unused]] int data = 0) override |
| 126 | { |
| 127 | /* Finish closing the dropdown, so it doesn't affect new window placement. |
| 128 | * Also mark it dirty in case the callback deals with the screen. (e.g. screenshots). */ |
| 129 | this->Window::Close(); |
| 130 | |
| 131 | Point pt = _cursor.pos; |
| 132 | pt.x -= this->parent->left; |
| 133 | pt.y -= this->parent->top; |
| 134 | this->parent->OnDropdownClose(pt, this->parent_button, this->selected_result, this->selected_click_result, this->options.Test(DropDownOption::InstantClose)); |
| 135 | |
| 136 | /* Set flag on parent widget to indicate that we have just closed. */ |
| 137 | NWidgetCore *nwc = this->parent->GetWidget<NWidgetCore>(this->parent_button); |
| 138 | if (nwc != nullptr) nwc->disp_flags.Set(NWidgetDisplayFlag::DropdownClosed); |
| 139 | } |
| 140 | |
| 141 | void OnFocusLost(bool closing) override |
| 142 | { |
no test coverage detected