Re-initialize all windows. */
| 3411 | |
| 3412 | /** Re-initialize all windows. */ |
| 3413 | void ReInitAllWindows(bool zoom_changed) |
| 3414 | { |
| 3415 | SetupWidgetDimensions(); |
| 3416 | NWidgetLeaf::InvalidateDimensionCache(); // Reset cached sizes of several widgets. |
| 3417 | NWidgetScrollbar::InvalidateDimensionCache(); |
| 3418 | |
| 3419 | InitDepotWindowBlockSizes(); |
| 3420 | |
| 3421 | /* When _gui_zoom has changed, we need to resize toolbar and statusbar first, |
| 3422 | * so EnsureVisibleCaption uses the updated size information. */ |
| 3423 | ReInitWindow(FindWindowById(WC_MAIN_TOOLBAR, 0), zoom_changed); |
| 3424 | ReInitWindow(FindWindowById(WC_STATUS_BAR, 0), zoom_changed); |
| 3425 | for (Window *w : Window::Iterate()) { |
| 3426 | if (w->window_class == WC_MAIN_TOOLBAR || w->window_class == WC_STATUS_BAR) continue; |
| 3427 | ReInitWindow(w, zoom_changed); |
| 3428 | } |
| 3429 | |
| 3430 | if (_networking) NetworkUndrawChatMessage(); |
| 3431 | NetworkReInitChatBoxSize(); |
| 3432 | |
| 3433 | /* Make sure essential parts of all windows are visible */ |
| 3434 | RelocateAllWindows(_screen.width, _screen.height); |
| 3435 | MarkWholeScreenDirty(); |
| 3436 | } |
| 3437 | |
| 3438 | /** |
| 3439 | * (Re)position a window at the screen. |
no test coverage detected