From 3c50a66cedfa1632cf151c9e7a031e042ffeb004 Mon Sep 17 00:00:00 2001 From: alberth Date: Thu, 2 Jul 2009 21:18:22 +0000 Subject: (svn r16727) -Codechange: Introducing WD_SORTBUTTON_ARROW_WIDTH constant. --- src/widget.cpp | 6 +++--- src/window_gui.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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 */ -- cgit v1.2.3-70-g09d2