File diff r16430:b3f65f9bc976 → r16431:ec558deca9d7
src/toolbar_gui.cpp
Show inline comments
 
@@ -135,13 +135,13 @@ public:
 
	{
 
		return DropDownListStringItem::Width() + this->checkmark_width;
 
	}
 

	
 
	void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const
 
	{
 
		bool rtl = _dynlang.text_dir == TD_RTL;
 
		bool rtl = _current_text_dir == TD_RTL;
 
		if (this->checked) {
 
			DrawString(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, STR_JUST_CHECKMARK, sel ? TC_WHITE : TC_BLACK);
 
		}
 
		DrawString(left + WD_FRAMERECT_LEFT + (rtl ? 0 : this->checkmark_width), right - WD_FRAMERECT_RIGHT - (rtl ? this->checkmark_width : 0), top, this->String(), sel ? TC_WHITE : TC_BLACK);
 
	}
 
};
 
@@ -174,13 +174,13 @@ public:
 
		return GetStringBoundingBox(STR_COMPANY_NAME_COMPANY_NUM).width + this->icon_width + 3;
 
	}
 

	
 
	void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const
 
	{
 
		CompanyID company = (CompanyID)this->result;
 
		bool rtl = _dynlang.text_dir == TD_RTL;
 
		bool rtl = _current_text_dir == TD_RTL;
 

	
 
		/* It's possible the company is deleted while the dropdown is open */
 
		if (!Company::IsValidID(company)) return;
 

	
 
		DrawCompanyIcon(company, rtl ? right - this->icon_width - WD_FRAMERECT_RIGHT : left + WD_FRAMERECT_LEFT, top + 1 + (FONT_HEIGHT_NORMAL - 10) / 2);
 

	
 
@@ -1051,13 +1051,13 @@ public:
 
	/* virtual */ void Draw(const Window *w)
 
	{
 
		/* Draw brown-red toolbar bg. */
 
		GfxFillRect(this->pos_x, this->pos_y, this->pos_x + this->current_x - 1, this->pos_y + this->current_y - 1, 0xB2);
 
		GfxFillRect(this->pos_x, this->pos_y, this->pos_x + this->current_x - 1, this->pos_y + this->current_y - 1, 0xB4, FILLRECT_CHECKER);
 

	
 
		bool rtl = _dynlang.text_dir == TD_RTL;
 
		bool rtl = _current_text_dir == TD_RTL;
 
		for (NWidgetBase *child_wid = rtl ? this->tail : this->head; child_wid != NULL; child_wid = rtl ? child_wid->prev : child_wid->next) {
 
			if (child_wid->type == NWID_SPACER) continue;
 
			if (!this->visible[((NWidgetCore*)child_wid)->index]) continue;
 

	
 
			child_wid->Draw(w);
 
		}