Changeset - r17647:d4b47933b13c
[Not reviewed]
master
0 21 0
frosch - 14 years ago 2011-05-06 21:13:29
frosch@openttd.org
(svn r22429) -Add: some constants for specific palette colours used in the GUI.
21 files changed with 79 insertions and 63 deletions:
0 comments (0 inline, 0 general)
src/ai/ai_gui.cpp
Show inline comments
 
@@ -975,13 +975,13 @@ struct AIDebugWindow : public QueryStrin
 
						case AILog::LOG_ERROR:    colour = TC_RED;    break;
 
						default:                  colour = TC_BLACK;  break;
 
					}
 

	
 
					/* Check if the current line should be highlighted */
 
					if (pos == this->highlight_row) {
 
						GfxFillRect(r.left + 1, r.top + y, r.right - 1, r.top + y + this->resize.step_height - WD_PAR_VSEP_NORMAL, GREY_SCALE(0));
 
						GfxFillRect(r.left + 1, r.top + y, r.right - 1, r.top + y + this->resize.step_height - WD_PAR_VSEP_NORMAL, PC_BLACK);
 
						if (colour == TC_BLACK) colour = TC_WHITE; // Make black text readable by inverting it to white.
 
					}
 

	
 
					DrawString(r.left + 7, r.right - 7, r.top + y, log->lines[pos], colour, SA_LEFT | SA_FORCE);
 
					y += this->resize.step_height;
 
				}
src/airport_gui.cpp
Show inline comments
 
@@ -353,13 +353,13 @@ public:
 
		switch (widget) {
 
			case BAIRW_AIRPORT_LIST: {
 
				int y = r.top;
 
				for (uint i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < AirportClass::GetCount(_selected_airport_class); i++) {
 
					const AirportSpec *as = AirportClass::Get(_selected_airport_class, i);
 
					if (!as->IsAvailable()) {
 
						GfxFillRect(r.left + 1, y + 1, r.right - 1, y + this->line_height - 2, GREY_SCALE(0), FILLRECT_CHECKER);
 
						GfxFillRect(r.left + 1, y + 1, r.right - 1, y + this->line_height - 2, PC_BLACK, FILLRECT_CHECKER);
 
					}
 
					DrawString(r.left + WD_MATRIX_LEFT, r.right + WD_MATRIX_RIGHT, y + WD_MATRIX_TOP, as->name, ((int)i == _selected_airport_index) ? TC_WHITE : TC_BLACK);
 
					y += this->line_height;
 
				}
 
				break;
 
			}
src/company_gui.cpp
Show inline comments
 
@@ -206,26 +206,26 @@ static void DrawYearColumn(const Rect &r
 
	int type = _settings_client.gui.expenses_layout;
 
	for (uint i = 0; i < _expenses_list_types[type].length; i++) {
 
		const ExpensesType et = _expenses_list_types[type].et[i];
 
		if (et == INVALID_EXPENSES) {
 
			Money cost = subtotal;
 
			subtotal = 0;
 
			GfxFillRect(r.left, y, r.right, y, GREY_SCALE(1));
 
			GfxFillRect(r.left, y, r.right, y, PC_BLACK);
 
			y += EXP_LINESPACE;
 
			DrawPrice(cost, r.left, r.right, y);
 
			y += FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE;
 
		} else {
 
			Money cost = (*tbl)[et];
 
			subtotal += cost;
 
			sum += cost;
 
			if (cost != 0) DrawPrice(cost, r.left, r.right, y);
 
			y += FONT_HEIGHT_NORMAL;
 
		}
 
	}
 

	
 
	GfxFillRect(r.left, y, r.right, y, GREY_SCALE(1));
 
	GfxFillRect(r.left, y, r.right, y, PC_BLACK);
 
	y += EXP_LINESPACE;
 
	DrawPrice(sum, r.left, r.right, y);
 
}
 

	
 
static const NWidgetPart _nested_company_finances_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
@@ -382,13 +382,13 @@ struct CompanyFinancesWindow : Window {
 
				SetDParam(0, c->money - c->current_loan);
 
				DrawString(r.left, r.right, r.top, STR_FINANCES_TOTAL_CURRENCY, TC_FROMSTRING, SA_RIGHT);
 
				break;
 
			}
 

	
 
			case CFW_LOAN_LINE:
 
				GfxFillRect(r.left, r.top, r.right, r.top, GREY_SCALE(1));
 
				GfxFillRect(r.left, r.top, r.right, r.top, PC_BLACK);
 
				break;
 
		}
 
	}
 

	
 
	/**
 
	 * Setup the widgets in the nested tree, such that the finances window is displayed properly.
src/console_gui.cpp
Show inline comments
 
@@ -201,13 +201,13 @@ struct IConsoleWindow : Window
 
	}
 

	
 
	virtual void OnPaint()
 
	{
 
		const int right = this->width - 5;
 

	
 
		GfxFillRect(0, 0, this->width - 1, this->height - 1, GREY_SCALE(0));
 
		GfxFillRect(0, 0, this->width - 1, this->height - 1, PC_BLACK);
 
		int ypos = this->height - this->line_height;
 
		for (const IConsoleLine *print = IConsoleLine::Get(IConsoleWindow::scroll); print != NULL; print = print->previous) {
 
			SetDParamStr(0, print->buffer);
 
			ypos = DrawStringMultiLine(5, right, -this->line_height, ypos, STR_JUST_RAW_STRING, print->colour, SA_LEFT | SA_BOTTOM | SA_FORCE) - ICON_LINE_SPACING;
 
			if (ypos < 0) break;
 
		}
src/fios_gui.cpp
Show inline comments
 
@@ -348,31 +348,31 @@ public:
 
				DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + FONT_HEIGHT_NORMAL + WD_FRAMERECT_TOP, str);
 
				DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, path, TC_BLACK);
 
				break;
 
			}
 

	
 
			case SLWW_DRIVES_DIRECTORIES_LIST: {
 
				GfxFillRect(r.left + 1, r.top + 1, r.right, r.bottom, GREY_SCALE(1));
 
				GfxFillRect(r.left + 1, r.top + 1, r.right, r.bottom, PC_BLACK);
 

	
 
				uint y = r.top + WD_FRAMERECT_TOP;
 
				for (uint pos = this->vscroll->GetPosition(); pos < _fios_items.Length(); pos++) {
 
					const FiosItem *item = _fios_items.Get(pos);
 

	
 
					if (item == this->selected) {
 
						GfxFillRect(r.left + 1, y, r.right, y + this->resize.step_height, 156);
 
						GfxFillRect(r.left + 1, y, r.right, y + this->resize.step_height, PC_DARK_BLUE);
 
					}
 
					DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, item->title, _fios_colours[item->type]);
 
					y += this->resize.step_height;
 
					if (y >= this->vscroll->GetCapacity() * this->resize.step_height + r.top + WD_FRAMERECT_TOP) break;
 
				}
 
				break;
 
			}
 

	
 
			case SLWW_DETAILS: {
 
				GfxFillRect(r.left + WD_FRAMERECT_LEFT, r.top + WD_FRAMERECT_TOP,
 
						r.right - WD_FRAMERECT_RIGHT, r.top + FONT_HEIGHT_NORMAL * 2 + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM, GREY_SCALE(10));
 
						r.right - WD_FRAMERECT_RIGHT, r.top + FONT_HEIGHT_NORMAL * 2 + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM, PC_GREY);
 
				DrawString(r.left, r.right, r.top + FONT_HEIGHT_NORMAL / 2 + WD_FRAMERECT_TOP, STR_SAVELOAD_DETAIL_CAPTION, TC_FROMSTRING, SA_HOR_CENTER);
 

	
 
				if (this->selected == NULL) break;
 

	
 
				uint y = r.top + FONT_HEIGHT_NORMAL * 2 + WD_PAR_VSEP_NORMAL + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
 
				uint y_max = r.bottom - FONT_HEIGHT_NORMAL - WD_FRAMERECT_BOTTOM;
src/gfx.cpp
Show inline comments
 
@@ -261,13 +261,13 @@ void DrawBox(int x, int y, int dx1, int 
 
	 *   :            |     ..
 
	 *    ....        |(dx3,dy3)
 
	 *        ....    | ..
 
	 *            ....V.
 
	 */
 

	
 
	static const byte colour = GREY_SCALE(15);
 
	static const byte colour = PC_WHITE;
 

	
 
	GfxDrawLineUnscaled(x, y, x + dx1, y + dy1, colour);
 
	GfxDrawLineUnscaled(x, y, x + dx2, y + dy2, colour);
 
	GfxDrawLineUnscaled(x, y, x + dx3, y + dy3, colour);
 

	
 
	GfxDrawLineUnscaled(x + dx1, y + dy1, x + dx1 + dx2, y + dy1 + dy2, colour);
src/gfx_func.h
Show inline comments
 
@@ -186,7 +186,23 @@ extern bool _palette_remap_grf[];
 
 * Return the colour for a particular greyscale level.
 
 * @param level Intensity, 0 = black, 15 = white
 
 * @return colour
 
 */
 
#define GREY_SCALE(level) (level)
 

	
 
static const uint8 PC_BLACK              = GREY_SCALE(1);  ///< Black palette colour.
 
static const uint8 PC_GREY               = GREY_SCALE(10); ///< Grey palette colour.
 
static const uint8 PC_WHITE              = GREY_SCALE(15); ///< White palette colour.
 

	
 
static const uint8 PC_VERY_DARK_RED      = 0xB2;           ///< Almost-black red palette colour.
 
static const uint8 PC_DARK_RED           = 0xB4;           ///< Dark red palette colour.
 
static const uint8 PC_RED                = 0xB8;           ///< Red palette colour.
 

	
 
static const uint8 PC_YELLOW             = 0xBF;           ///< Yellow palette colour.
 
static const uint8 PC_LIGHT_YELLOW       = 0x44;           ///< Light yellow palette colour.
 
static const uint8 PC_VERY_LIGHT_YELLOW  = 0x45;           ///< Almost-white yellow palette colour.
 

	
 
static const uint8 PC_GREEN              = 0xD0;           ///< Green palette colour.
 

	
 
static const uint8 PC_DARK_BLUE          = 0x9D;           ///< Dark blue palette colour.
 

	
 
#endif /* GFX_FUNC_H */
src/graph_gui.cpp
Show inline comments
 
@@ -174,13 +174,13 @@ enum CompanyValueWidgets {
 
	BGW_RESIZE,
 
};
 

	
 
struct BaseGraphWindow : Window {
 
protected:
 
	static const int GRAPH_MAX_DATASETS     =  32;
 
	static const int GRAPH_AXIS_LINE_COLOUR = GREY_SCALE(1);
 
	static const int GRAPH_AXIS_LINE_COLOUR = PC_BLACK;
 
	static const int GRAPH_NUM_MONTHS       =  24; ///< Number of months displayed in the graph.
 

	
 
	static const int MIN_GRAPH_NUM_LINES_Y  =   9; ///< Minimal number of horizontal lines to draw.
 
	static const int MIN_GRID_PIXEL_SIZE    =  20; ///< Minimum distance between graph lines.
 

	
 
	uint excluded_data; ///< bitmask of the datasets that shouldn't be displayed.
 
@@ -974,13 +974,13 @@ struct PaymentRatesGraphWindow : BaseGra
 
		byte clk_dif = this->IsWidgetLowered(widget) ? 1 : 0;
 
		int x = r.left + WD_FRAMERECT_LEFT;
 
		int y = r.top;
 

	
 
		int rect_x = clk_dif + (rtl ? r.right - 12 : r.left + WD_FRAMERECT_LEFT);
 

	
 
		GfxFillRect(rect_x, y + clk_dif, rect_x + 8, y + 5 + clk_dif, GREY_SCALE(0));
 
		GfxFillRect(rect_x, y + clk_dif, rect_x + 8, y + 5 + clk_dif, PC_BLACK);
 
		GfxFillRect(rect_x + 1, y + 1 + clk_dif, rect_x + 7, y + 4 + clk_dif, cs->legend_colour);
 
		SetDParam(0, cs->name);
 
		DrawString(rtl ? r.left : x + 14 + clk_dif, (rtl ? r.right - 14 + clk_dif : r.right), y + clk_dif, STR_GRAPH_CARGO_PAYMENT_CARGO);
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget, int click_count)
 
@@ -1422,13 +1422,13 @@ struct PerformanceRatingDetailWindow : W
 
		}
 

	
 
		if (!IsInsideMM(widget, PRW_SCORE_FIRST, PRW_SCORE_LAST + 1)) return;
 

	
 
		ScoreID score_type = (ScoreID)(widget - PRW_SCORE_FIRST);
 

	
 
			/* The colours used to show how the progress is going */
 
		/* The colours used to show how the progress is going */
 
		int colour_done = _colour_gradient[COLOUR_GREEN][4];
 
		int colour_notdone = _colour_gradient[COLOUR_RED][4];
 

	
 
		/* Draw all the score parts */
 
		int val    = _score_part[company][score_type];
 
		int needed = _score_info[score_type].needed;
src/industry_gui.cpp
Show inline comments
 
@@ -393,13 +393,13 @@ public:
 
						continue;
 
					}
 
					const IndustrySpec *indsp = GetIndustrySpec(this->index[i + this->vscroll->GetPosition()]);
 

	
 
					/* Draw the name of the industry in white is selected, otherwise, in orange */
 
					DrawString(x + MATRIX_TEXT_OFFSET, r.right - WD_MATRIX_RIGHT, y, indsp->name, selected ? TC_WHITE : TC_ORANGE);
 
					GfxFillRect(x,     y + 1,  x + 10, y + 7, selected ? GREY_SCALE(15) : GREY_SCALE(0));
 
					GfxFillRect(x,     y + 1,  x + 10, y + 7, selected ? PC_WHITE : PC_BLACK);
 
					GfxFillRect(x + 1, y + 2,  x +  9, y + 6, indsp->map_colour);
 
				}
 
				break;
 

	
 
			case DPIW_INFOPANEL: {
 
				int y      = r.top    + WD_FRAMERECT_TOP;
 
@@ -1674,13 +1674,13 @@ struct CargoesField {
 
						blob_right = xpos2 - BLOB_DISTANCE;
 
						blob_left  = blob_right - BLOB_WIDTH;
 
					} else {
 
						blob_left  = xpos + BLOB_DISTANCE;
 
						blob_right = blob_left + BLOB_WIDTH;
 
					}
 
					GfxFillRect(blob_left,     ypos2 - BLOB_DISTANCE - BLOB_HEIGHT,     blob_right,     ypos2 - BLOB_DISTANCE,     GREY_SCALE(0)); // Border
 
					GfxFillRect(blob_left,     ypos2 - BLOB_DISTANCE - BLOB_HEIGHT,     blob_right,     ypos2 - BLOB_DISTANCE,     PC_BLACK); // Border
 
					GfxFillRect(blob_left + 1, ypos2 - BLOB_DISTANCE - BLOB_HEIGHT + 1, blob_right - 1, ypos2 - BLOB_DISTANCE - 1, indsp->map_colour);
 
				} else {
 
					DrawString(xpos, xpos2, ypos, STR_INDUSTRY_CARGOES_HOUSES, TC_FROMSTRING, SA_HOR_CENTER);
 
				}
 

	
 
				/* Draw the other_produced/other_accepted cargoes. */
 
@@ -1896,14 +1896,14 @@ const int CargoesField::BLOB_DISTANCE = 
 
const int CargoesField::BLOB_WIDTH    = 12; ///< Width of the industry legend colour, including border.
 
const int CargoesField::BLOB_HEIGHT   =  9; ///< Height of the industry legend colour, including border
 

	
 
/** Width of a #CFT_CARGO field. */
 
const int CargoesField::CARGO_FIELD_WIDTH = HOR_CARGO_BORDER_SPACE * 2 + HOR_CARGO_WIDTH * MAX_CARGOES + HOR_CARGO_SPACE * (MAX_CARGOES - 1);
 

	
 
const int CargoesField::INDUSTRY_LINE_COLOUR = 191; ///< Line colour of the industry type box.
 
const int CargoesField::CARGO_LINE_COLOUR    = 191; ///< Line colour around the cargo.
 
const int CargoesField::INDUSTRY_LINE_COLOUR = PC_YELLOW; ///< Line colour of the industry type box.
 
const int CargoesField::CARGO_LINE_COLOUR    = PC_YELLOW; ///< Line colour around the cargo.
 

	
 
/** A single row of #CargoesField. */
 
struct CargoesRow {
 
	CargoesField columns[5]; ///< One row of fields.
 

	
 
	/**
src/misc_gui.cpp
Show inline comments
 
@@ -927,14 +927,14 @@ struct TooltipsWindow : public Window
 
		size->height += 2 + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
 
	}
 

	
 
	virtual void DrawWidget(const Rect &r, int widget) const
 
	{
 
		/* There is only one widget. */
 
		GfxFillRect(r.left, r.top, r.right, r.bottom, GREY_SCALE(0));
 
		GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, 0x44);
 
		GfxFillRect(r.left, r.top, r.right, r.bottom, PC_BLACK);
 
		GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_LIGHT_YELLOW);
 

	
 
		for (uint arg = 0; arg < this->paramcount; arg++) {
 
			SetDParam(arg, this->params[arg]);
 
		}
 
		DrawStringMultiLine(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, r.bottom - WD_FRAMERECT_BOTTOM, this->string_id, TC_FROMSTRING, SA_CENTER);
 
	}
 
@@ -1300,13 +1300,13 @@ void QueryString::DrawEditBox(Window *w,
 
	assert((wi->type & WWT_MASK) == WWT_EDITBOX);
 
	int left   = wi->pos_x;
 
	int right  = wi->pos_x + wi->current_x - 1;
 
	int top    = wi->pos_y;
 
	int bottom = wi->pos_y + wi->current_y - 1;
 

	
 
	GfxFillRect(left + 1, top + 1, right - 1, bottom - 1, GREY_SCALE(1));
 
	GfxFillRect(left + 1, top + 1, right - 1, bottom - 1, PC_BLACK);
 

	
 
	/* Limit the drawing of the string inside the widget boundaries */
 
	DrawPixelInfo dpi;
 
	if (!FillDrawPixelInfo(&dpi, left + WD_FRAMERECT_LEFT, top + WD_FRAMERECT_TOP, right - left - WD_FRAMERECT_RIGHT, bottom - top - WD_FRAMERECT_BOTTOM)) return;
 

	
 
	DrawPixelInfo *old_dpi = _cur_dpi;
src/music_gui.cpp
Show inline comments
 
@@ -367,13 +367,13 @@ struct MusicTrackSelectionWindow : publi
 
	}
 

	
 
	virtual void DrawWidget(const Rect &r, int widget) const
 
	{
 
		switch (widget) {
 
			case MTSW_LIST_LEFT: {
 
				GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, GREY_SCALE(0));
 
				GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK);
 

	
 
				int y = r.top + WD_FRAMERECT_TOP;
 
				for (uint i = 0; i < NUM_SONGS_AVAILABLE; i++) {
 
					const char *song_name = GetSongName(i);
 
					if (StrEmpty(song_name)) continue;
 

	
 
@@ -384,13 +384,13 @@ struct MusicTrackSelectionWindow : publi
 
					y += FONT_HEIGHT_SMALL;
 
				}
 
				break;
 
			}
 

	
 
			case MTSW_LIST_RIGHT: {
 
				GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, GREY_SCALE(0));
 
				GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK);
 

	
 
				int y = r.top + WD_FRAMERECT_TOP;
 
				for (const byte *p = _playlists[_settings_client.music.playlist]; *p != 0; p++) {
 
					uint i = *p - 1;
 
					SetDParam(0, GetTrackNumber(i));
 
					SetDParam(1, 2);
 
@@ -589,40 +589,40 @@ struct MusicWindow : public Window {
 
	}
 

	
 
	virtual void DrawWidget(const Rect &r, int widget) const
 
	{
 
		switch (widget) {
 
			case MW_GAUGE:
 
				GfxFillRect(r.left, r.top, r.right, r.bottom, GREY_SCALE(0));
 
				GfxFillRect(r.left, r.top, r.right, r.bottom, PC_BLACK);
 

	
 
				for (uint i = 0; i != 8; i++) {
 
					int colour = 0xD0;
 
					int colour = PC_GREEN;
 
					if (i > 4) {
 
						colour = 0xBF;
 
						colour = PC_YELLOW;
 
						if (i > 6) {
 
							colour = 0xB8;
 
							colour = PC_RED;
 
						}
 
					}
 
					GfxFillRect(r.left, r.bottom - i * 2, r.right, r.bottom - i * 2, colour);
 
				}
 
				break;
 

	
 
			case MW_TRACK_NR: {
 
				GfxFillRect(r.left + 1, r.top + 1, r.right, r.bottom, GREY_SCALE(0));
 
				GfxFillRect(r.left + 1, r.top + 1, r.right, r.bottom, PC_BLACK);
 
				StringID str = STR_MUSIC_TRACK_NONE;
 
				if (_song_is_active != 0 && _music_wnd_cursong != 0) {
 
					SetDParam(0, GetTrackNumber(_music_wnd_cursong - 1));
 
					SetDParam(1, 2);
 
					str = STR_MUSIC_TRACK_DIGIT;
 
				}
 
				DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, str);
 
				break;
 
			}
 

	
 
			case MW_TRACK_NAME: {
 
				GfxFillRect(r.left, r.top + 1, r.right - 1, r.bottom, GREY_SCALE(0));
 
				GfxFillRect(r.left, r.top + 1, r.right - 1, r.bottom, PC_BLACK);
 
				StringID str = STR_MUSIC_TITLE_NONE;
 
				if (_song_is_active != 0 && _music_wnd_cursong != 0) {
 
					str = STR_MUSIC_TITLE_NAME;
 
					SetDParamStr(0, GetSongName(_music_wnd_cursong - 1));
 
				}
 
				DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, str, TC_FROMSTRING, SA_HOR_CENTER);
src/network/network_content_gui.cpp
Show inline comments
 
@@ -452,13 +452,13 @@ public:
 
		int sprite_y_offset = WD_MATRIX_TOP + (FONT_HEIGHT_NORMAL - 10) / 2;
 
		uint y = r.top;
 
		int cnt = 0;
 
		for (ConstContentIterator iter = this->content.Get(this->vscroll->GetPosition()); iter != this->content.End() && cnt < this->vscroll->GetCapacity(); iter++, cnt++) {
 
			const ContentInfo *ci = *iter;
 

	
 
			if (ci == this->selected) GfxFillRect(r.left + 1, y + 1, r.right - 1, y + this->resize.step_height - 1, GREY_SCALE(10));
 
			if (ci == this->selected) GfxFillRect(r.left + 1, y + 1, r.right - 1, y + this->resize.step_height - 1, PC_GREY);
 

	
 
			SpriteID sprite;
 
			SpriteID pal = PAL_NONE;
 
			switch (ci->state) {
 
				case ContentInfo::UNSELECTED:     sprite = SPR_BOX_EMPTY;   break;
 
				case ContentInfo::SELECTED:       sprite = SPR_BOX_CHECKED; break;
 
@@ -488,13 +488,13 @@ public:
 
		static const int DETAIL_TOP          =  5; ///< Number of pixels at the top
 

	
 
		/* Height for the title banner */
 
		int DETAIL_TITLE_HEIGHT = 5 * FONT_HEIGHT_NORMAL;
 

	
 
		/* Create the nice grayish rectangle at the details top */
 
		GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + DETAIL_TITLE_HEIGHT, 157);
 
		GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + DETAIL_TITLE_HEIGHT, PC_DARK_BLUE);
 
		DrawString(r.left + WD_INSET_LEFT, r.right - WD_INSET_RIGHT, r.top + FONT_HEIGHT_NORMAL + WD_INSET_TOP, STR_CONTENT_DETAIL_TITLE, TC_FROMSTRING, SA_HOR_CENTER);
 

	
 
		/* Draw the total download size */
 
		SetDParam(0, this->filesize_sum);
 
		DrawString(r.left + DETAIL_LEFT, r.right - DETAIL_RIGHT, r.bottom - FONT_HEIGHT_NORMAL - WD_PAR_VSEP_NORMAL, STR_CONTENT_TOTAL_DOWNLOAD_SIZE);
 

	
src/network/network_gui.cpp
Show inline comments
 
@@ -379,13 +379,13 @@ protected:
 
	void DrawServerLine(const NetworkGameList *cur_item, uint y, bool highlight) const
 
	{
 
		const NWidgetBase *nwi_name = this->GetWidget<NWidgetBase>(NGWW_NAME);
 
		const NWidgetBase *nwi_info = this->GetWidget<NWidgetBase>(NGWW_INFO);
 

	
 
		/* show highlighted item with a different colour */
 
		if (highlight) GfxFillRect(nwi_name->pos_x + 1, y - 2, nwi_info->pos_x + nwi_info->current_x - 2, y + FONT_HEIGHT_NORMAL - 1, GREY_SCALE(10));
 
		if (highlight) GfxFillRect(nwi_name->pos_x + 1, y - 2, nwi_info->pos_x + nwi_info->current_x - 2, y + FONT_HEIGHT_NORMAL - 1, PC_GREY);
 

	
 
		DrawString(nwi_name->pos_x + WD_FRAMERECT_LEFT, nwi_name->pos_x + nwi_name->current_x - WD_FRAMERECT_RIGHT, y, cur_item->info.server_name, TC_BLACK);
 

	
 
		/* only draw details if the server is online */
 
		if (cur_item->online) {
 
			const NWidgetServerListHeader *nwi_header = this->GetWidget<NWidgetServerListHeader>(NGWW_HEADER);
 
@@ -607,13 +607,13 @@ public:
 
	{
 
		NetworkGameList *sel = this->server;
 

	
 
		const int detail_height = 6 + 8 + 6 + 3 * FONT_HEIGHT_NORMAL;
 

	
 
		/* Draw the right menu */
 
		GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + detail_height - 1, 157);
 
		GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + detail_height - 1, PC_DARK_BLUE);
 
		if (sel == NULL) {
 
			DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6 + 4 + FONT_HEIGHT_NORMAL, STR_NETWORK_SERVER_LIST_GAME_INFO, TC_FROMSTRING, SA_HOR_CENTER);
 
		} else if (!sel->online) {
 
			DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6 + 4 + FONT_HEIGHT_NORMAL, sel->info.server_name, TC_ORANGE, SA_HOR_CENTER); // game name
 

	
 
			DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + detail_height + 4, STR_NETWORK_SERVER_LIST_SERVER_OFFLINE, TC_FROMSTRING, SA_HOR_CENTER); // server offline
 
@@ -1487,13 +1487,13 @@ struct NetworkLobbyWindow : public Windo
 
		/* Draw company list */
 
		int pos = this->vscroll->GetPosition();
 
		while (pos < this->server->info.companies_on) {
 
			byte company = NetworkLobbyFindCompanyIndex(pos);
 
			bool income = false;
 
			if (this->company == company) {
 
				GfxFillRect(r.left + 1, y - 2, r.right - 1, y + FONT_HEIGHT_NORMAL, GREY_SCALE(10)); // show highlighted item with a different colour
 
				GfxFillRect(r.left + 1, y - 2, r.right - 1, y + FONT_HEIGHT_NORMAL, PC_GREY); // show highlighted item with a different colour
 
			}
 

	
 
			DrawString(text_left, text_right, y, this->company_info[company].company_name, TC_BLACK);
 
			if (this->company_info[company].use_password != 0) DrawSprite(SPR_LOCK, PAL_NONE, lock_left, y + lock_y_offset);
 

	
 
			/* If the company's income was positive puts a green dot else a red dot */
 
@@ -1507,13 +1507,13 @@ struct NetworkLobbyWindow : public Windo
 
	}
 

	
 
	void DrawDetails(const Rect &r) const
 
	{
 
		const int detail_height = 12 + FONT_HEIGHT_NORMAL + 12;
 
		/* Draw info about selected company when it is selected in the left window */
 
		GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + detail_height - 1, 157);
 
		GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + detail_height - 1, PC_DARK_BLUE);
 
		DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 12, STR_NETWORK_GAME_LOBBY_COMPANY_INFO, TC_FROMSTRING, SA_HOR_CENTER);
 

	
 
		if (this->company == INVALID_COMPANY || StrEmpty(this->company_info[this->company].company_name)) return;
 

	
 
		int y = r.top + detail_height + 4;
 
		const NetworkGameInfo *gi = &this->server->info;
 
@@ -1823,13 +1823,13 @@ struct NetworkClientListPopupWindow : Wi
 
		/* Draw the actions */
 
		int sel = this->sel_index;
 
		int y = r.top + WD_FRAMERECT_TOP;
 
		for (const ClientListAction *action = this->actions.Begin(); action != this->actions.End(); action++, y += FONT_HEIGHT_NORMAL) {
 
			TextColour colour;
 
			if (sel-- == 0) { // Selected item, highlight it
 
				GfxFillRect(r.left + 1, y, r.right - 1, y + FONT_HEIGHT_NORMAL - 1, GREY_SCALE(0));
 
				GfxFillRect(r.left + 1, y, r.right - 1, y + FONT_HEIGHT_NORMAL - 1, PC_BLACK);
 
				colour = TC_WHITE;
 
			} else {
 
				colour = TC_BLACK;
 
			}
 

	
 
			DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, action->name, colour);
 
@@ -1975,13 +1975,13 @@ struct NetworkClientListWindow : Window 
 

	
 
		int i = 0;
 
		const NetworkClientInfo *ci;
 
		FOR_ALL_CLIENT_INFOS(ci) {
 
			TextColour colour;
 
			if (this->selected_item == i++) { // Selected item, highlight it
 
				GfxFillRect(r.left + 1, y, r.right - 1, y + FONT_HEIGHT_NORMAL - 1, GREY_SCALE(0));
 
				GfxFillRect(r.left + 1, y, r.right - 1, y + FONT_HEIGHT_NORMAL - 1, PC_BLACK);
 
				colour = TC_WHITE;
 
			} else {
 
				colour = TC_BLACK;
 
			}
 

	
 
			if (ci->client_id == CLIENT_ID_SERVER) {
src/newgrf_gui.cpp
Show inline comments
 
@@ -692,13 +692,13 @@ struct NewGRFWindow : public QueryString
 
	}
 

	
 
	virtual void DrawWidget(const Rect &r, int widget) const
 
	{
 
		switch (widget) {
 
			case SNGRFS_FILE_LIST: {
 
				GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, GREY_SCALE(1));
 
				GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK);
 

	
 
				uint step_height = this->GetWidget<NWidgetBase>(SNGRFS_FILE_LIST)->resize_y;
 
				uint y = r.top + WD_FRAMERECT_TOP;
 
				int sprite_offset_y = (step_height - 10) / 2;
 
				int offset_y = (step_height - FONT_HEIGHT_NORMAL) / 2;
 

	
 
@@ -712,47 +712,47 @@ struct NewGRFWindow : public QueryString
 
				for (const GRFConfig *c = this->actives; c != NULL; c = c->next, i++) {
 
					if (this->vscroll->IsVisible(i)) {
 
						const char *text = c->GetName();
 
						bool h = (this->active_sel == c);
 
						PaletteID pal = this->GetPalette(c);
 

	
 
						if (h) GfxFillRect(r.left + 1, y, r.right - 1, y + step_height - 1, 156);
 
						if (h) GfxFillRect(r.left + 1, y, r.right - 1, y + step_height - 1, PC_DARK_BLUE);
 
						DrawSprite(SPR_SQUARE, pal, square_left, y + sprite_offset_y);
 
						if (c->error != NULL) DrawSprite(SPR_WARNING_SIGN, 0, warning_left, y + sprite_offset_y);
 
						uint txtoffset = c->error == NULL ? 0 : 10;
 
						DrawString(text_left + (rtl ? 0 : txtoffset), text_right - (rtl ? txtoffset : 0), y + offset_y, text, h ? TC_WHITE : TC_ORANGE);
 
						y += step_height;
 
					}
 
				}
 
				break;
 
			}
 

	
 
			case SNGRFS_AVAIL_LIST: {
 
				GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, GREY_SCALE(1));
 
				GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK);
 

	
 
				uint step_height = this->GetWidget<NWidgetBase>(SNGRFS_AVAIL_LIST)->resize_y;
 
				int offset_y = (step_height - FONT_HEIGHT_NORMAL) / 2;
 
				uint y = r.top + WD_FRAMERECT_TOP;
 
				uint min_index = this->vscroll2->GetPosition();
 
				uint max_index = min(min_index + this->vscroll2->GetCapacity(), this->avails.Length());
 

	
 
				for (uint i = min_index; i < max_index; i++) {
 
					const GRFConfig *c = this->avails[i];
 
					bool h = (c == this->avail_sel);
 
					const char *text = c->GetName();
 

	
 
					if (h) GfxFillRect(r.left + 1, y, r.right - 1, y + step_height - 1, 156);
 
					if (h) GfxFillRect(r.left + 1, y, r.right - 1, y + step_height - 1, PC_DARK_BLUE);
 
					DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y + offset_y, text, h ? TC_WHITE : TC_SILVER);
 
					y += step_height;
 
				}
 
				break;
 
			}
 

	
 
			case SNGRFS_NEWGRF_INFO_TITLE:
 
				/* Create the nice grayish rectangle at the details top. */
 
				GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, 157);
 
				GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_DARK_BLUE);
 
				DrawString(r.left, r.right, (r.top + r.bottom - FONT_HEIGHT_NORMAL) / 2, STR_NEWGRF_SETTINGS_INFO_TITLE, TC_FROMSTRING, SA_HOR_CENTER);
 
				break;
 

	
 
			case SNGRFS_NEWGRF_INFO: {
 
				const GRFConfig *selected = this->active_sel;
 
				if (selected == NULL) selected = this->avail_sel;
src/news_gui.cpp
Show inline comments
 
@@ -332,18 +332,18 @@ struct NewsWindow : Window {
 

	
 
		PositionNewsMessage(this);
 
	}
 

	
 
	void DrawNewsBorder(const Rect &r) const
 
	{
 
		GfxFillRect(r.left,  r.top,    r.right, r.bottom, GREY_SCALE(15));
 
		GfxFillRect(r.left,  r.top,    r.right, r.bottom, PC_WHITE);
 

	
 
		GfxFillRect(r.left,  r.top,    r.left,  r.bottom, GREY_SCALE(1));
 
		GfxFillRect(r.right, r.top,    r.right, r.bottom, GREY_SCALE(1));
 
		GfxFillRect(r.left,  r.top,    r.right, r.top,    GREY_SCALE(1));
 
		GfxFillRect(r.left,  r.bottom, r.right, r.bottom, GREY_SCALE(1));
 
		GfxFillRect(r.left,  r.top,    r.left,  r.bottom, PC_BLACK);
 
		GfxFillRect(r.right, r.top,    r.right, r.bottom, PC_BLACK);
 
		GfxFillRect(r.left,  r.top,    r.right, r.top,    PC_BLACK);
 
		GfxFillRect(r.left,  r.bottom, r.right, r.bottom, PC_BLACK);
 
	}
 

	
 
	virtual Point OnInitialPosition(const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number)
 
	{
 
		Point pt = { 0, _screen.height };
 
		return pt;
 
@@ -422,13 +422,13 @@ struct NewsWindow : Window {
 
			}
 
			case NTW_COMPANY_MSG:
 
				DrawStringMultiLine(r.left, r.right, r.top, r.bottom, this->GetCompanyMessageString(), TC_FROMSTRING, SA_CENTER);
 
				break;
 

	
 
			case NTW_VEH_BKGND:
 
				GfxFillRect(r.left, r.top, r.right, r.bottom, GREY_SCALE(10));
 
				GfxFillRect(r.left, r.top, r.right, r.bottom, PC_GREY);
 
				break;
 

	
 
			case NTW_VEH_NAME:
 
			case NTW_VEH_TITLE:
 
				DrawStringMultiLine(r.left, r.right, r.top, r.bottom, this->GetNewVehicleMessageString(widget), TC_FROMSTRING, SA_CENTER);
 
				break;
src/object_gui.cpp
Show inline comments
 
@@ -203,13 +203,13 @@ public:
 

	
 
				int obj_index = GB(widget, 16, 16);
 
				const ObjectSpec *spec = ObjectClass::Get(_selected_object_class, obj_index);
 
				if (spec == NULL) break;
 

	
 
				if (!spec->IsAvailable()) {
 
					GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, GREY_SCALE(0), FILLRECT_CHECKER);
 
					GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK, FILLRECT_CHECKER);
 
				}
 
				DrawPixelInfo tmp_dpi;
 
				/* Set up a clipping area for the preview. */
 
				if (FillDrawPixelInfo(&tmp_dpi, r.left + 1, r.top, (r.right - 1) - (r.left + 1) + 1, r.bottom - r.top + 1)) {
 
					DrawPixelInfo *old_dpi = _cur_dpi;
 
					_cur_dpi = &tmp_dpi;
src/rail_gui.cpp
Show inline comments
 
@@ -1160,13 +1160,13 @@ public:
 
				byte type = GB(widget, 16, 16);
 
				assert(type < _railstation.station_count);
 
				/* Check station availability callback */
 
				const StationSpec *statspec = StationClass::Get(_railstation.station_class, type);
 
				if (statspec != NULL && HasBit(statspec->callback_mask, CBM_STATION_AVAIL) &&
 
						GB(GetStationCallback(CBID_STATION_AVAILABILITY, 0, 0, statspec, NULL, INVALID_TILE), 0, 8) == 0) {
 
					GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, GREY_SCALE(0), FILLRECT_CHECKER);
 
					GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK, FILLRECT_CHECKER);
 
				}
 

	
 
				/* Set up a clipping area for the station preview. */
 
				if (FillDrawPixelInfo(&tmp_dpi, r.left + 1, r.top + 1, r.right - (r.left + 1) + 1, r.bottom - 1 - (r.top + 1) + 1)) {
 
					DrawPixelInfo *old_dpi = _cur_dpi;
 
					_cur_dpi = &tmp_dpi;
 
@@ -1812,13 +1812,13 @@ struct BuildRailWaypointWindow : PickerW
 
				const StationSpec *statspec = StationClass::Get(STAT_CLASS_WAYP, type);
 
				DrawWaypointSprite(r.left + TILE_PIXELS, r.bottom - TILE_PIXELS, type, _cur_railtype);
 

	
 
				if (statspec != NULL &&
 
						HasBit(statspec->callback_mask, CBM_STATION_AVAIL) &&
 
						GB(GetStationCallback(CBID_STATION_AVAILABILITY, 0, 0, statspec, NULL, INVALID_TILE), 0, 8) == 0) {
 
					GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, 0, FILLRECT_CHECKER);
 
					GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK, FILLRECT_CHECKER);
 
				}
 
			}
 
		}
 
	}
 

	
 
	virtual void OnClick(Point pt, int widget, int click_count)
src/smallmap_gui.cpp
Show inline comments
 
@@ -890,26 +890,26 @@ class SmallMapWindow : public Window {
 
	 * @param x X coord of left/right border of main viewport
 
	 * @param y Y coord of top border of main viewport
 
	 * @param y2 Y coord of bottom border of main viewport
 
	 */
 
	static inline void DrawVertMapIndicator(int x, int y, int y2)
 
	{
 
		GfxFillRect(x, y,      x, y + 3, 69);
 
		GfxFillRect(x, y2 - 3, x, y2,    69);
 
		GfxFillRect(x, y,      x, y + 3, PC_VERY_LIGHT_YELLOW);
 
		GfxFillRect(x, y2 - 3, x, y2,    PC_VERY_LIGHT_YELLOW);
 
	}
 

	
 
	/**
 
	 * Draws horizontal part of map indicator
 
	 * @param x X coord of left border of main viewport
 
	 * @param x2 X coord of right border of main viewport
 
	 * @param y Y coord of top/bottom border of main viewport
 
	 */
 
	static inline void DrawHorizMapIndicator(int x, int x2, int y)
 
	{
 
		GfxFillRect(x,      y, x + 3, y, 69);
 
		GfxFillRect(x2 - 3, y, x2,    y, 69);
 
		GfxFillRect(x,      y, x + 3, y, PC_VERY_LIGHT_YELLOW);
 
		GfxFillRect(x2 - 3, y, x2,    y, PC_VERY_LIGHT_YELLOW);
 
	}
 

	
 
	/**
 
	 * Adds map indicators to the smallmap.
 
	 */
 
	void DrawMapIndicators() const
 
@@ -949,13 +949,13 @@ class SmallMapWindow : public Window {
 
		DrawPixelInfo *old_dpi;
 

	
 
		old_dpi = _cur_dpi;
 
		_cur_dpi = dpi;
 

	
 
		/* Clear it */
 
		GfxFillRect(dpi->left, dpi->top, dpi->left + dpi->width - 1, dpi->top + dpi->height - 1, GREY_SCALE(0));
 
		GfxFillRect(dpi->left, dpi->top, dpi->left + dpi->width - 1, dpi->top + dpi->height - 1, PC_BLACK);
 

	
 
		/* Which tile is displayed at (dpi->left, dpi->top)? */
 
		int dx;
 
		Point tile = this->PixelToTile(dpi->left, dpi->top, &dx);
 
		int tile_x = this->scroll_x / (int)TILE_SIZE + tile.x;
 
		int tile_y = this->scroll_y / (int)TILE_SIZE + tile.y;
 
@@ -1201,29 +1201,29 @@ public:
 
						if (!tbl->show_on_map) {
 
							/* Simply draw the string, not the black border of the legend colour.
 
							 * This will enforce the idea of the disabled item */
 
							DrawString(x + text_left, x + text_right, y, STR_SMALLMAP_INDUSTRY, TC_GREY);
 
						} else {
 
							DrawString(x + text_left, x + text_right, y, STR_SMALLMAP_INDUSTRY, TC_BLACK);
 
							GfxFillRect(x + blob_left, y + 1, x + blob_right, y + row_height - 1, GREY_SCALE(0)); // Outer border of the legend colour
 
							GfxFillRect(x + blob_left, y + 1, x + blob_right, y + row_height - 1, PC_BLACK); // Outer border of the legend colour
 
						}
 
					} else if (this->map_type == SMT_OWNER && tbl->company != INVALID_COMPANY) {
 
						SetDParam(0, tbl->company);
 
						if (!tbl->show_on_map) {
 
							/* Simply draw the string, not the black border of the legend colour.
 
							 * This will enforce the idea of the disabled item */
 
							DrawString(x + text_left, x + text_right, y, STR_SMALLMAP_COMPANY, TC_GREY);
 
						} else {
 
							DrawString(x + text_left, x + text_right, y, STR_SMALLMAP_COMPANY, TC_BLACK);
 
							GfxFillRect(x + blob_left, y + 1, x + blob_right, y + row_height - 1, GREY_SCALE(0)); // Outer border of the legend colour
 
							GfxFillRect(x + blob_left, y + 1, x + blob_right, y + row_height - 1, PC_BLACK); // Outer border of the legend colour
 
						}
 
					} else {
 
						if (this->map_type == SMT_CONTOUR) SetDParam(0, tbl->height * TILE_HEIGHT_STEP);
 

	
 
						/* Anything that is not an industry or a company is using normal process */
 
						GfxFillRect(x + blob_left, y + 1, x + blob_right, y + row_height - 1, GREY_SCALE(0));
 
						GfxFillRect(x + blob_left, y + 1, x + blob_right, y + row_height - 1, PC_BLACK);
 
						DrawString(x + text_left, x + text_right, y, tbl->legend);
 
					}
 
					GfxFillRect(x + blob_left + 1, y + 2, x + blob_right - 1, y + row_height - 2, tbl->colour); // Legend colour
 

	
 
					y += row_height;
 
				}
src/station_gui.cpp
Show inline comments
 
@@ -165,15 +165,15 @@ static void StationsWndShowStationRating
 
	}
 

	
 
	DrawString(left + 1, right, y, cs->abbrev, TC_BLACK);
 

	
 
	/* Draw green/red ratings bar (fits into 14 pixels) */
 
	y += height + 2;
 
	GfxFillRect(left + 1, y, left + 14, y, 0xB8);
 
	GfxFillRect(left + 1, y, left + 14, y, PC_RED);
 
	rating = minu(rating, rating_full) / 16;
 
	if (rating != 0) GfxFillRect(left + 1, y, left + rating, y, 0xD0);
 
	if (rating != 0) GfxFillRect(left + 1, y, left + rating, y, PC_GREEN);
 
}
 

	
 
typedef GUIList<const Station*> GUIStationList;
 

	
 
/** Enum for CompanyStations, referring to _company_stations_widgets */
 
enum StationListWidgets {
src/toolbar_gui.cpp
Show inline comments
 
@@ -1130,14 +1130,14 @@ 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);
 
		GfxFillRect(this->pos_x, this->pos_y, this->pos_x + this->current_x - 1, this->pos_y + this->current_y - 1, PC_VERY_DARK_RED);
 
		GfxFillRect(this->pos_x, this->pos_y, this->pos_x + this->current_x - 1, this->pos_y + this->current_y - 1, PC_DARK_RED, FILLRECT_CHECKER);
 

	
 
		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;
 

	
src/widgets/dropdown.cpp
Show inline comments
 
@@ -245,13 +245,13 @@ struct DropdownWindow : Window {
 

	
 
			/* Skip items that are scrolled up */
 
			if (--pos >= 0) continue;
 

	
 
			if (y + item_height < r.bottom) {
 
				bool selected = (this->selected_index == item->result);
 
				if (selected) GfxFillRect(r.left + 2, y, r.right - 1, y + item_height - 1, GREY_SCALE(0));
 
				if (selected) GfxFillRect(r.left + 2, y, r.right - 1, y + item_height - 1, PC_BLACK);
 

	
 
				item->Draw(r.left, r.right, y, r.bottom, selected, colour);
 

	
 
				if (item->masked) {
 
					GfxFillRect(r.left + 1, y, r.right - 1, y + item_height - 1, _colour_gradient[colour][5], FILLRECT_CHECKER);
 
				}
0 comments (0 inline, 0 general)