* Draw a sort button's up or down arrow symbol. * @param widget Sort button widget * @param state State of sort button */
| 814 | * @param state State of sort button |
| 815 | */ |
| 816 | void Window::DrawSortButtonState(WidgetID widget, SortButtonState state) const |
| 817 | { |
| 818 | if (state == SBS_OFF) return; |
| 819 | |
| 820 | assert(!this->widget_lookup.empty()); |
| 821 | Rect r = this->GetWidget<NWidgetBase>(widget)->GetCurrentRect(); |
| 822 | |
| 823 | /* Sort button uses the same sprites as vertical scrollbar */ |
| 824 | Dimension dim = NWidgetScrollbar::GetVerticalDimension(); |
| 825 | |
| 826 | DrawSpriteIgnorePadding(state == SBS_DOWN ? SPR_ARROW_DOWN : SPR_ARROW_UP, PAL_NONE, r.WithWidth(dim.width, _current_text_dir == TD_LTR), SA_CENTER); |
| 827 | } |
| 828 | |
| 829 | /** |
| 830 | * Get width of up/down arrow of sort button state. |
no test coverage detected