summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-07-02 21:18:22 +0000
committeralberth <alberth@openttd.org>2009-07-02 21:18:22 +0000
commit3c50a66cedfa1632cf151c9e7a031e042ffeb004 (patch)
tree717ed43758afab6af31dd8599f4b304691635fde /src
parent7e852ab44698694044b09a98b942bde4b4827751 (diff)
downloadopenttd-3c50a66cedfa1632cf151c9e7a031e042ffeb004.tar.xz
(svn r16727) -Codechange: Introducing WD_SORTBUTTON_ARROW_WIDTH constant.
Diffstat (limited to 'src')
-rw-r--r--src/widget.cpp6
-rw-r--r--src/window_gui.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/src/widget.cpp b/src/widget.cpp
index 390012879..73056788e 100644
--- a/src/widget.cpp
+++ b/src/widget.cpp
@@ -815,14 +815,14 @@ void Window::DrawSortButtonState(int widget, SortButtonState state) const
int offset = this->IsWidgetLowered(widget) ? 1 : 0;
int base, top;
if (this->widget != NULL) {
- base = offset + (_dynlang.text_dir == TD_LTR ? this->widget[widget].right - 11 : this->widget[widget].left);
+ base = offset + (_dynlang.text_dir == TD_LTR ? this->widget[widget].right - WD_SORTBUTTON_ARROW_WIDTH : this->widget[widget].left);
top = this->widget[widget].top;
} else {
assert(this->nested_array != NULL);
- base = offset + this->nested_array[widget]->pos_x + (_dynlang.text_dir == TD_LTR ? this->nested_array[widget]->current_x - 11 : 0);
+ base = offset + this->nested_array[widget]->pos_x + (_dynlang.text_dir == TD_LTR ? this->nested_array[widget]->current_x - WD_SORTBUTTON_ARROW_WIDTH : 0);
top = this->nested_array[widget]->pos_y;
}
- DrawString(base, base + 11, top + 1 + offset, state == SBS_DOWN ? DOWNARROW : UPARROW, TC_BLACK, SA_CENTER);
+ DrawString(base, base + WD_SORTBUTTON_ARROW_WIDTH, top + 1 + offset, state == SBS_DOWN ? DOWNARROW : UPARROW, TC_BLACK, SA_CENTER);
}
diff --git a/src/window_gui.h b/src/window_gui.h
index 2847bad48..552c0a6e2 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -76,6 +76,8 @@ enum WidgetDrawDistances {
WD_DROPDOWNTEXT_LEFT = 2, ///< Left offset of the dropdown widget string.
WD_DROPDOWNTEXT_RIGHT = 14, ///< Right offset of the dropdown widget string.
WD_DROPDOWNTEXT_TOP = 1, ///< Top offset of the dropdown widget string.
+
+ WD_SORTBUTTON_ARROW_WIDTH = 11, ///< Width of up/down arrow of sort button state.
};
/* wiget.cpp */