Changeset - r12300:489a80ad79ba
[Not reviewed]
master
0 2 0
alberth - 15 years ago 2009-07-02 21:18:22
alberth@openttd.org
(svn r16727) -Codechange: Introducing WD_SORTBUTTON_ARROW_WIDTH constant.
2 files changed with 5 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/widget.cpp
Show inline comments
 
@@ -815,14 +815,14 @@ void Window::DrawSortButtonState(int wid
 
	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);
 
}
 

	
 

	
src/window_gui.h
Show inline comments
 
@@ -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 */
0 comments (0 inline, 0 general)