changeset 11507:034f89d22bc0 draft

(svn r15868) -Codechange: remove the close box from the widget array instead of doing it in the constructor of the difficulty window. This makes it work again in rtl languages.
author yexo <yexo@openttd.org>
date Sat, 28 Mar 2009 02:54:40 +0000
parents a952351a6319
children 06e6021a10f2
files src/settings_gui.cpp
diffstat 1 files changed, 2 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -385,7 +385,6 @@
 
 /* Names of the game difficulty settings window */
 enum GameDifficultyWidgets {
-	GDW_CLOSEBOX = 0,
 	GDW_CAPTION,
 	GDW_UPPER_BG,
 	GDW_LVL_EASY,
@@ -401,8 +400,7 @@
 
 /* Widget definition for the game difficulty settings window */
 static const Widget _game_difficulty_widgets[] = {
-{   WWT_CLOSEBOX,   RESIZE_NONE,  COLOUR_MAUVE,      0,    10,     0,    13, STR_00C5,                     STR_018B_CLOSE_WINDOW},           // GDW_CLOSEBOX
-{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_MAUVE,     11,   369,     0,    13, STR_6800_DIFFICULTY_LEVEL,    STR_018C_WINDOW_TITLE_DRAG_THIS}, // GDW_CAPTION
+{    WWT_CAPTION,   RESIZE_NONE,  COLOUR_MAUVE,      0,   369,     0,    13, STR_6800_DIFFICULTY_LEVEL,    STR_018C_WINDOW_TITLE_DRAG_THIS}, // GDW_CAPTION
 {      WWT_PANEL,   RESIZE_NONE,  COLOUR_MAUVE,      0,   369,    14,    41, 0x0,                          STR_NULL},                        // GDW_UPPER_BG
 { WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_YELLOW,    10,    96,    16,    27, STR_6801_EASY,                STR_NULL},                        // GDW_LVL_EASY
 { WWT_PUSHTXTBTN,   RESIZE_NONE,  COLOUR_YELLOW,    97,   183,    16,    27, STR_6802_MEDIUM,              STR_NULL},                        // GDW_LVL_MEDIUM
@@ -417,10 +415,7 @@
 };
 
 static const NWidgetPart _nested_game_difficulty_widgets[] = {
-	NWidget(NWID_HORIZONTAL),
-		NWidget(WWT_CLOSEBOX, COLOUR_MAUVE, GDW_CLOSEBOX),
-		NWidget(WWT_CAPTION, COLOUR_MAUVE, GDW_CAPTION), SetMinimalSize(359, 14), SetDataTip(STR_6800_DIFFICULTY_LEVEL, STR_018C_WINDOW_TITLE_DRAG_THIS),
-	EndContainer(),
+	NWidget(WWT_CAPTION, COLOUR_MAUVE, GDW_CAPTION), SetMinimalSize(370, 14), SetDataTip(STR_6800_DIFFICULTY_LEVEL, STR_018C_WINDOW_TITLE_DRAG_THIS),
 	NWidget(WWT_PANEL, COLOUR_MAUVE, GDW_UPPER_BG),
 		NWidget(NWID_SPACER), SetMinimalSize(0, 2),
 		NWidget(NWID_HORIZONTAL),
@@ -487,9 +482,6 @@
 		this->clicked_increase = false;
 		this->clicked_button = NO_SETTINGS_BUTTON;
 		this->timeout = 0;
-		/* Hide the closebox to make sure that the user aborts or confirms his changes */
-		this->HideWidget(GDW_CLOSEBOX);
-		this->widget[GDW_CAPTION].left = 0;
 		/* Setup disabled buttons when creating window
 		 * disable all other difficulty buttons during gameplay except for 'custom' */
 		this->SetWidgetsDisabledState(_game_mode == GM_NORMAL,