* Paint all widgets of a window. */
| 782 | * Paint all widgets of a window. |
| 783 | */ |
| 784 | void Window::DrawWidgets() const |
| 785 | { |
| 786 | this->nested_root->Draw(this); |
| 787 | |
| 788 | if (this->flags.Test(WindowFlag::WhiteBorder)) { |
| 789 | DrawFrameRect(0, 0, this->width - 1, this->height - 1, COLOUR_WHITE, FrameFlag::BorderOnly); |
| 790 | } |
| 791 | |
| 792 | if (this->flags.Test(WindowFlag::Highlighted)) { |
| 793 | extern bool _window_highlight_colour; |
| 794 | for (const auto &pair : this->widget_lookup) { |
| 795 | const NWidgetBase *widget = pair.second; |
| 796 | if (!widget->IsHighlighted()) continue; |
| 797 | |
| 798 | Rect outer = widget->GetCurrentRect(); |
| 799 | Rect inner = outer.Shrink(WidgetDimensions::scaled.bevel).Expand(1); |
| 800 | |
| 801 | PixelColour colour = _string_colourmap[_window_highlight_colour ? widget->GetHighlightColour() : TC_WHITE]; |
| 802 | |
| 803 | GfxFillRect(outer.left, outer.top, inner.left, inner.bottom, colour); |
| 804 | GfxFillRect(inner.left + 1, outer.top, inner.right - 1, inner.top, colour); |
| 805 | GfxFillRect(inner.right, outer.top, outer.right, inner.bottom, colour); |
| 806 | GfxFillRect(outer.left + 1, inner.bottom, outer.right - 1, outer.bottom, colour); |
| 807 | } |
| 808 | } |
| 809 | } |
| 810 | |
| 811 | /** |
| 812 | * Draw a sort button's up or down arrow symbol. |
no test coverage detected