# HG changeset patch # User peter1138 # Date 2019-03-09 18:20:03 # Node ID 2965f5a62eaac4284b25873c384381681d9f1d9d # Parent 7b9a736249f0a86a426b082232959ab25bef6cf4 Codechange: Use Colours type instead of byte. diff --git a/src/company_gui.cpp b/src/company_gui.cpp --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -536,7 +536,7 @@ public: return true; } - void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const + void Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const { bool rtl = _current_text_dir == TD_RTL; int height = bottom - top; diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -578,7 +578,7 @@ public: return true; } - void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const + void Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const { DrawString(left + 2, right + 2, top, _grf_preset_list[this->result], sel ? TC_WHITE : TC_BLACK); } diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -104,7 +104,7 @@ public: return DropDownListStringItem::Width() + this->checkmark_width; } - void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const + void Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const { bool rtl = _current_text_dir == TD_RTL; if (this->checked) { @@ -149,7 +149,7 @@ public: return max(max(this->icon_size.height, this->lock_size.height) + 2U, (uint)FONT_HEIGHT_NORMAL); } - void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const + void Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const { CompanyID company = (CompanyID)this->result; bool rtl = _current_text_dir == TD_RTL; diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -22,7 +22,7 @@ #include "../safeguards.h" -void DropDownListItem::Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const +void DropDownListItem::Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const { int c1 = _colour_gradient[bg_colour][3]; int c2 = _colour_gradient[bg_colour][7]; @@ -39,7 +39,7 @@ uint DropDownListStringItem::Width() con return GetStringBoundingBox(buffer).width; } -void DropDownListStringItem::Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const +void DropDownListStringItem::Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const { DrawString(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, this->String(), sel ? TC_WHITE : TC_BLACK); } diff --git a/src/widgets/dropdown_type.h b/src/widgets/dropdown_type.h --- a/src/widgets/dropdown_type.h +++ b/src/widgets/dropdown_type.h @@ -32,7 +32,7 @@ public: virtual bool Selectable() const { return false; } virtual uint Height(uint width) const { return FONT_HEIGHT_NORMAL; } virtual uint Width() const { return 0; } - virtual void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const; + virtual void Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const; }; /** @@ -47,7 +47,7 @@ public: virtual bool Selectable() const { return true; } virtual uint Width() const; - virtual void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const; + virtual void Draw(int left, int right, int top, int bottom, bool sel, Colours bg_colour) const; virtual StringID String() const { return this->string; } static int CDECL NatSortFunc(const DropDownListItem * const *first, const DropDownListItem * const *second);