|
@@ -24,27 +24,25 @@
|
|
|
void DropDownListItem::Draw(const Rect &r, bool sel, Colours bg_colour) const
|
|
|
{
|
|
|
int c1 = _colour_gradient[bg_colour][3];
|
|
|
int c2 = _colour_gradient[bg_colour][7];
|
|
|
|
|
|
int mid = CenterBounds(r.top, r.bottom, 0);
|
|
|
GfxFillRect(r.left, mid - WidgetDimensions::scaled.bevel.bottom, r.right, mid - 1, c1);
|
|
|
GfxFillRect(r.left, mid, r.right, mid + WidgetDimensions::scaled.bevel.top - 1, c2);
|
|
|
}
|
|
|
|
|
|
uint DropDownListStringItem::Width() const
|
|
|
{
|
|
|
char buffer[512];
|
|
|
GetString(buffer, this->String(), lastof(buffer));
|
|
|
return GetStringBoundingBox(buffer).width + WidgetDimensions::scaled.dropdowntext.Horizontal();
|
|
|
return GetStringBoundingBox(this->String()).width + WidgetDimensions::scaled.dropdowntext.Horizontal();
|
|
|
}
|
|
|
|
|
|
void DropDownListStringItem::Draw(const Rect &r, bool sel, Colours bg_colour) const
|
|
|
{
|
|
|
Rect ir = r.Shrink(WidgetDimensions::scaled.dropdowntext);
|
|
|
DrawString(ir.left, ir.right, r.top, this->String(), sel ? TC_WHITE : TC_BLACK);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Natural sorting comparator function for DropDownList::sort().
|
|
|
* @param first Left side of comparison.
|
|
|
* @param second Right side of comparison.
|