MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / UnfocusWidgets

Method UnfocusWidgets

src/widget.cpp:3521–3531  ·  view source on GitHub ↗

* Unfocuses the focused widget of the window, * if the focused widget is contained inside the container. * @param parent_window Window which contains this container. */

Source from the content-addressed store, hash-verified

3519 * @param parent_window Window which contains this container.
3520 */
3521void NWidgetContainer::UnfocusWidgets(Window *parent_window)
3522{
3523 assert(parent_window != nullptr);
3524 if (parent_window->nested_focus != nullptr) {
3525 for (auto &widget : this->children) {
3526 if (parent_window->nested_focus == widget.get()) {
3527 parent_window->UnfocusFocusedWidget();
3528 }
3529 }
3530 }
3531}

Callers 1

ClearMethod · 0.95

Calls 2

UnfocusFocusedWidgetMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected