diff options
Diffstat (limited to 'src/widgets/dropdown.cpp')
-rw-r--r-- | src/widgets/dropdown.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 42cd28d0f..986d051d5 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -39,6 +39,16 @@ StringID DropDownListParamStringItem::String() const return this->string; } +uint DropDownListCharStringItem::Width() const +{ + return GetStringBoundingBox(this->string).width; +} + +void DropDownListCharStringItem::Draw(int x, int y, uint width, uint height, bool sel, int bg_colour) const +{ + DoDrawStringTruncated(this->string, x + 2, y, sel ? TC_WHITE : TC_BLACK, width); +} + /** * Delete all items of a drop down list and the list itself * @param list List to delete. |