summaryrefslogtreecommitdiff
path: root/src/newgrf_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-06-01 14:41:09 +0000
committerfrosch <frosch@openttd.org>2012-06-01 14:41:09 +0000
commit056f779334baf1857686453a8b382daf079311de (patch)
treeb1aee9f3e86b072ac264e88e7be885a4b9fc64b7 /src/newgrf_gui.cpp
parent198de5397ed4a217273bda29dae8ddf60ba48f1d (diff)
downloadopenttd-056f779334baf1857686453a8b382daf079311de.tar.xz
(svn r24310) -Codechange: Add named constants for the dimensions of settings buttons, and generally make their usage more consistent.
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r--src/newgrf_gui.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 447345ef0..d36513ca9 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -247,9 +247,9 @@ struct NewGRFParametersWindow : public Window {
}
bool rtl = _current_text_dir == TD_RTL;
- uint buttons_left = rtl ? r.right - 23 : r.left + 4;
- uint text_left = r.left + (rtl ? WD_FRAMERECT_LEFT : 28);
- uint text_right = r.right - (rtl ? 28 : WD_FRAMERECT_RIGHT);
+ uint buttons_left = rtl ? r.right - SETTING_BUTTON_WIDTH - 3 : r.left + 4;
+ uint text_left = r.left + (rtl ? WD_FRAMERECT_LEFT : SETTING_BUTTON_WIDTH + 8);
+ uint text_right = r.right - (rtl ? SETTING_BUTTON_WIDTH + 8 : WD_FRAMERECT_RIGHT);
int y = r.top;
for (uint i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < this->vscroll->GetCount(); i++) {
@@ -327,13 +327,13 @@ struct NewGRFParametersWindow : public Window {
if (par_info == NULL) par_info = GetDummyParameterInfo(num);
/* One of the arrows is clicked */
- if (IsInsideMM(x, 0, 21)) {
+ if (IsInsideMM(x, 0, SETTING_BUTTON_WIDTH)) {
uint32 val = par_info->GetValue(this->grf_config);
uint32 old_val = val;
if (par_info->type == PTYPE_BOOL) {
val = !val;
} else {
- if (x >= 10) {
+ if (x >= SETTING_BUTTON_WIDTH / 2) {
/* Increase button clicked */
if (val < par_info->max_value) val++;
this->clicked_increase = true;