diff -r fb873780b4e4 -r 2a6ee708ccd4 src/settings_gui.cpp --- a/src/settings_gui.cpp Sun Sep 28 11:28:18 2008 +0200 +++ b/src/settings_gui.cpp Sun Sep 28 11:28:18 2008 +0200 @@ -749,7 +749,8 @@ }; struct PatchesSelectionWindow : Window { - static const int setting_height; ///< Height of a single advanced setting text + static const int setting_height; ///< Height of a single advanced setting text + static const int config_patch_x_start; ///< Horizontal start of each advanced setting text static GameSettings *patches_ptr; static int patches_max; ///< Maximal number of patches at a single page @@ -794,6 +795,9 @@ this->LowerWidget(PATCHSEL_INTERFACE); this->FindWindowPlacementAndResize(desc); + + /* Check that start positions advanced setting entries are nicely aligned in the option panel widget */ + assert(config_patch_x_start == desc->widgets[PATCHSEL_OPTIONSPANEL].left + 5); } virtual void OnPaint() @@ -805,7 +809,7 @@ /* Set up selected category */ this->DrawWidgets(); - x = 5; + x = config_patch_x_start; y = 47; for (i = 0; i != page->num; i++) { const SettingDesc *sd = page->entries[i].setting; @@ -848,7 +852,7 @@ SetDParam(1, value); } } - DrawString(30, y, (sdb->str) + disabled, TC_FROMSTRING); + DrawString(25 + x, y, (sdb->str) + disabled, TC_FROMSTRING); y += setting_height; } } @@ -867,7 +871,7 @@ y = pt.y - 46 - 1; // Shift y coordinate if (y < 0) return; // Clicked above first entry - x = pt.x - 5; // Shift x coordinate + x = pt.x - config_patch_x_start; // Shift x coordinate if (x < 0) return; // Clicked left of the entry btn = y / setting_height; // Compute which setting is selected @@ -975,6 +979,7 @@ }; const int PatchesSelectionWindow::setting_height = 11; +const int PatchesSelectionWindow::config_patch_x_start = 5; GameSettings *PatchesSelectionWindow::patches_ptr = NULL; int PatchesSelectionWindow::patches_max = 0;