From 5489b9fc0c331ff10ba66bf3b684eec1d86bb835 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Fri, 24 Nov 2023 21:51:35 +0000 Subject: [PATCH] Codechange: Undo #11447, drop down list divider lines are now explicit. --- src/widgets/dropdown.cpp | 10 +++------- src/widgets/dropdown_type.h | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index b7b423d12d..ebf40fe909 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -48,14 +48,10 @@ uint DropDownListStringItem::Width() const return GetStringBoundingBox(this->String()).width + WidgetDimensions::scaled.dropdowntext.Horizontal(); } -void DropDownListStringItem::Draw(const Rect &r, bool sel, Colours bg_colour) const +void DropDownListStringItem::Draw(const Rect &r, bool sel, Colours) const { - if (this->String().empty()) { - this->DropDownListItem::Draw(r, sel, bg_colour); - } else { - Rect ir = r.Shrink(WidgetDimensions::scaled.dropdowntext); - DrawString(ir.left, ir.right, r.top, this->String(), sel ? TC_WHITE : TC_BLACK); - } + Rect ir = r.Shrink(WidgetDimensions::scaled.dropdowntext); + DrawString(ir.left, ir.right, r.top, this->String(), sel ? TC_WHITE : TC_BLACK); } /** diff --git a/src/widgets/dropdown_type.h b/src/widgets/dropdown_type.h index 3c045bd50e..62a6c30e2b 100644 --- a/src/widgets/dropdown_type.h +++ b/src/widgets/dropdown_type.h @@ -42,7 +42,7 @@ public: DropDownListStringItem(StringID string, int result, bool masked); DropDownListStringItem(const std::string &string, int result, bool masked); - bool Selectable() const override { return !this->String().empty(); } + bool Selectable() const override { return true; } uint Width() const override; void Draw(const Rect &r, bool sel, Colours bg_colour) const override; virtual const std::string &String() const { return this->string; }