* Makes no widget on this window have focus. The function however doesn't change which window has focus. */
| 469 | * Makes no widget on this window have focus. The function however doesn't change which window has focus. |
| 470 | */ |
| 471 | void Window::UnfocusFocusedWidget() |
| 472 | { |
| 473 | if (this->nested_focus != nullptr) { |
| 474 | if (this->nested_focus->type == WWT_EDITBOX) VideoDriver::GetInstance()->EditBoxLostFocus(); |
| 475 | |
| 476 | /* Repaint the widget that lost focus. A focused edit box may else leave the caret on the screen. */ |
| 477 | this->nested_focus->SetDirty(this); |
| 478 | this->nested_focus = nullptr; |
| 479 | } |
| 480 | } |
| 481 | |
| 482 | /** |
| 483 | * Set focus within this window to the given widget. The function however doesn't change which window has focus. |
no test coverage detected