summaryrefslogtreecommitdiff
path: root/src/newgrf_gui.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2014-10-04 18:19:22 +0000
committerpeter1138 <peter1138@openttd.org>2014-10-04 18:19:22 +0000
commitd4a9b3acedb52bfe6d59aec6fe9c2a83996f066d (patch)
tree64e14032f955438370f7221168b96d9ea4d14a5a /src/newgrf_gui.cpp
parent49a4a5958dd903974d8c0785797f085926b4a97d (diff)
downloadopenttd-d4a9b3acedb52bfe6d59aec6fe9c2a83996f066d.tar.xz
(svn r26954) -Codechange: GUI-scale for AI/GS settings and NewGRF settings windows.
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r--src/newgrf_gui.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index b211c1cb4..2945f9945 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -199,7 +199,8 @@ struct NewGRFParametersWindow : public Window {
switch (widget) {
case WID_NP_NUMPAR_DEC:
case WID_NP_NUMPAR_INC: {
- size->width = size->height = FONT_HEIGHT_NORMAL;
+ size->width = max(SETTING_BUTTON_WIDTH / 2, FONT_HEIGHT_NORMAL);
+ size->height = max(SETTING_BUTTON_HEIGHT, FONT_HEIGHT_NORMAL);
break;
}
@@ -213,7 +214,7 @@ struct NewGRFParametersWindow : public Window {
}
case WID_NP_BACKGROUND:
- this->line_height = FONT_HEIGHT_NORMAL + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
+ this->line_height = max(SETTING_BUTTON_HEIGHT, FONT_HEIGHT_NORMAL) + WD_MATRIX_TOP + WD_MATRIX_BOTTOM;
resize->width = 1;
resize->height = this->line_height;
@@ -266,6 +267,7 @@ struct NewGRFParametersWindow : public Window {
int y = r.top;
int button_y_offset = (this->line_height - SETTING_BUTTON_HEIGHT) / 2;
+ int text_y_offset = (this->line_height - FONT_HEIGHT_NORMAL) / 2;
for (uint i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < this->vscroll->GetCount(); i++) {
GRFParameterInfo *par_info = (i < this->grf_config->param_info.Length()) ? this->grf_config->param_info[i] : NULL;
if (par_info == NULL) par_info = GetDummyParameterInfo(i);
@@ -301,7 +303,7 @@ struct NewGRFParametersWindow : public Window {
SetDParam(1, i + 1);
}
- DrawString(text_left, text_right, y + WD_MATRIX_TOP, STR_NEWGRF_PARAMETERS_SETTING, selected ? TC_WHITE : TC_LIGHT_BLUE);
+ DrawString(text_left, text_right, y + text_y_offset, STR_NEWGRF_PARAMETERS_SETTING, selected ? TC_WHITE : TC_LIGHT_BLUE);
y += this->line_height;
}
}