box_content_divider.h 878 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // This file is part of Desktop App Toolkit,
  2. // a set of libraries for developing nice desktop applications.
  3. //
  4. // For license and copyright information please follow this link:
  5. // https://github.com/desktop-app/legal/blob/master/LEGAL
  6. //
  7. #pragma once
  8. #include "ui/rp_widget.h"
  9. #include "ui/rect_part.h"
  10. namespace Ui {
  11. class BoxContentDivider : public Ui::RpWidget {
  12. public:
  13. BoxContentDivider(QWidget *parent);
  14. BoxContentDivider(QWidget *parent, int height);
  15. BoxContentDivider(
  16. QWidget *parent,
  17. int height,
  18. const style::color &bg,
  19. RectParts parts = RectPart::Top | RectPart::Bottom);
  20. [[nodiscard]] const style::color &color() const;
  21. protected:
  22. void paintEvent(QPaintEvent *e) override;
  23. void paintTop(QPainter &p, int skip = 0);
  24. void paintBottom(QPainter &p, int skip = 0);
  25. private:
  26. const style::color &_bg;
  27. const RectParts _parts;
  28. };
  29. } // namespace Ui