diff options
Diffstat (limited to 'src/widget.cpp')
-rw-r--r-- | src/widget.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/widget.cpp b/src/widget.cpp index 9cb767149..d13352f77 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -14,6 +14,9 @@ #include "table/sprites.h" #include "table/strings.h" +static const char *UPARROW = "\xEE\x8A\x80"; +static const char *DOWNARROW = "\xEE\x8A\xAA"; + static Point HandleScrollbarHittest(const Scrollbar *sb, int top, int bottom) { Point pt; @@ -579,3 +582,16 @@ void ResizeButtons(Window *w, byte left, byte right) } } } + +/** Draw a sort button's up or down arrow symbol. + * @param w Window of widget + * @param widget Sort button widget + * @param state State of sort button + */ +void DrawSortButtonState(const Window *w, int widget, SortButtonState state) +{ + if (state == SBS_OFF) return; + + int offset = w->IsWidgetLowered(widget) ? 1 : 0; + DoDrawString(state == SBS_DOWN ? DOWNARROW : UPARROW, w->widget[widget].right - 11 + offset, w->widget[widget].top + 1 + offset, TC_BLACK); +} |