StylePainter.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include <LibDraw/Color.h>
  3. class Painter;
  4. class Palette;
  5. class Rect;
  6. enum class ButtonStyle {
  7. Normal,
  8. CoolBar
  9. };
  10. enum class FrameShadow {
  11. Plain,
  12. Raised,
  13. Sunken
  14. };
  15. enum class FrameShape {
  16. NoFrame,
  17. Box,
  18. Container,
  19. Panel,
  20. VerticalLine,
  21. HorizontalLine
  22. };
  23. class StylePainter {
  24. public:
  25. static void paint_button(Painter&, const Rect&, const Palette&, ButtonStyle, bool pressed, bool hovered = false, bool checked = false, bool enabled = true);
  26. static void paint_tab_button(Painter&, const Rect&, const Palette&, bool active, bool hovered, bool enabled);
  27. static void paint_surface(Painter&, const Rect&, const Palette&, bool paint_vertical_lines = true, bool paint_top_line = true);
  28. static void paint_frame(Painter&, const Rect&, const Palette&, FrameShape, FrameShadow, int thickness, bool skip_vertical_lines = false);
  29. static void paint_window_frame(Painter&, const Rect&, const Palette&);
  30. static void paint_progress_bar(Painter&, const Rect&, const Palette&, int min, int max, int value, const StringView& text = {});
  31. static void paint_radio_button(Painter&, const Rect&, const Palette&, bool is_checked, bool is_being_pressed);
  32. };