diff -r f32d2a055f90 src/settings_gui.cpp --- a/src/settings_gui.cpp Sun Nov 02 15:20:26 2008 +0100 +++ b/src/settings_gui.cpp Sun Nov 02 15:21:40 2008 +0100 @@ -752,6 +752,7 @@ struct PatchesSelectionWindow : Window { static const int SETTINGTREE_LEFT_OFFSET; ///< Position of left edge of patch values + static const int SETTINGTREE_TOP_OFFSET; ///< Position of top edge of patch values static GameSettings *patches_ptr; ///< Pointer to the game settings being displayed and modified static int patches_max; ///< Maximal number of patches on a single page @@ -763,9 +764,11 @@ PatchesSelectionWindow(const WindowDesc *desc) : Window(desc) { /* Check that the widget doesn't get moved without adapting the constant as well. - * SETTINGTREE_LEFT_OFFSET should be 5 pixels to the right of the left edge of the panel + * - SETTINGTREE_LEFT_OFFSET should be 5 pixels to the right of the left edge of the panel + * - SETTINGTREE_TOP_OFFSET should be 5 pixels below the top edge of the panel */ assert(this->widget[PATCHSEL_OPTIONSPANEL].left + 5 == SETTINGTREE_LEFT_OFFSET); + assert(this->widget[PATCHSEL_OPTIONSPANEL].top + 5 == SETTINGTREE_TOP_OFFSET); static bool first_time = true; @@ -805,7 +808,6 @@ virtual void OnPaint() { - int y; const PatchPage *page = &_patches_page[this->page]; uint i; @@ -813,7 +815,7 @@ this->DrawWidgets(); int x = SETTINGTREE_LEFT_OFFSET; - y = 47; + int y = SETTINGTREE_TOP_OFFSET; for (i = 0; i != page->num; i++) { const SettingDesc *sd = page->entries[i].setting; const SettingDescBase *sdb = &sd->desc; @@ -871,7 +873,7 @@ int x, y; byte btn; - y = pt.y - 46 - 1; // Shift y coordinate + y = pt.y - SETTINGTREE_TOP_OFFSET; // Shift y coordinate if (y < 0) return; // Clicked above first entry x = pt.x - SETTINGTREE_LEFT_OFFSET; // Shift x coordinate @@ -983,6 +985,7 @@ GameSettings *PatchesSelectionWindow::patches_ptr = NULL; const int PatchesSelectionWindow::SETTINGTREE_LEFT_OFFSET = 5; +const int PatchesSelectionWindow::SETTINGTREE_TOP_OFFSET = 47; int PatchesSelectionWindow::patches_max = 0; static const Widget _patches_selection_widgets[] = {