diff -r 0567377e89d7 -r 1a23bac52645 src/settings_gui.cpp --- a/src/settings_gui.cpp Sun Sep 28 14:07:05 2008 +0200 +++ b/src/settings_gui.cpp Sun Sep 28 14:07:05 2008 +0200 @@ -761,7 +761,7 @@ static const int config_patch_y_start; ///< Vertical position of first advanced setting text static GameSettings *patches_ptr; - static int patches_max; ///< Maximal number of patches at a single page + static int option_panel_max_height; ///< Needed height of the option panel to display all pages int page; int entry; @@ -783,8 +783,6 @@ count++; page->num_entries = count; - if (patches_max < page->num_entries) patches_max = page->num_entries; - page->entries = MallocT(page->num_entries); uint16 y = config_patch_y_start; for (uint i = 0; i != page->num_entries; i++) { @@ -798,15 +796,17 @@ y += setting_height; } + /* Update needed height of the option panel */ + option_panel_max_height = max(y - config_patch_y_start, option_panel_max_height); } first_time = false; } /* Resize the window to fit the largest patch tab */ - ResizeWindowForWidget(this, PATCHSEL_OPTIONSPANEL, 0, patches_max * setting_height); + ResizeWindowForWidget(this, PATCHSEL_OPTIONSPANEL, 0, option_panel_max_height); /* Recentre the window for the new size */ - this->top = this->top - (patches_max * setting_height) / 2; + this->top = this->top - option_panel_max_height / 2; this->LowerWidget(PATCHSEL_INTERFACE); @@ -992,7 +992,7 @@ const int PatchesSelectionWindow::config_patch_x_start = 5; const int PatchesSelectionWindow::config_patch_y_start = 47; GameSettings *PatchesSelectionWindow::patches_ptr = NULL; -int PatchesSelectionWindow::patches_max = 0; +int PatchesSelectionWindow::option_panel_max_height = 0; static const Widget _patches_selection_widgets[] = { { WWT_CLOSEBOX, RESIZE_NONE, COLOUR_MAUVE, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},