| 71 | } |
| 72 | |
| 73 | void draw_button(Surface* surface, int x, Hit button, const Hit hit) |
| 74 | { |
| 75 | Paint p; |
| 76 | gfx::Rect box(x, 0, kButtonSize, kButtonSize); |
| 77 | |
| 78 | p.color(hit == button ? kTitleBarHigh : kTitleBarBase); |
| 79 | p.style(Paint::Fill); |
| 80 | surface->drawRect(box, p); |
| 81 | |
| 82 | p.color(gfx::rgba(25, 25, 50)); |
| 83 | p.style(Paint::Stroke); |
| 84 | surface->drawRect(gfx::Rect(x, 0, 2, kButtonSize), p); |
| 85 | |
| 86 | // Draw icon |
| 87 | box.shrink(11); |
| 88 | box.inflate(1, 1); |
| 89 | p.strokeWidth(1.5f); |
| 90 | p.antialias(true); |
| 91 | switch (button) { |
| 92 | case Hit::MinimizeButton: surface->drawRect(gfx::Rect(box.x, box.y2() - 2, box.w, 1), p); break; |
| 93 | case Hit::MaximizeButton: surface->drawRect(gfx::Rect(box), p); break; |
| 94 | case Hit::CloseButton: { |
| 95 | gfx::Path path; |
| 96 | path.moveTo(box.x, box.y); |
| 97 | path.lineTo(box.x2(), box.y2()); |
| 98 | path.moveTo(box.x2(), box.y); |
| 99 | path.lineTo(box.x, box.y2()); |
| 100 | surface->drawPath(path, p); |
| 101 | break; |
| 102 | } |
| 103 | default: break; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | void draw_window(Window* window, const FontRef& font, const Hit hit) |
| 108 | { |
no test coverage detected