outline_segments.h 736 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. namespace Ui {
  9. inline constexpr auto kOutlineSegmentsMax = 50;
  10. struct OutlineSegment {
  11. QBrush brush;
  12. float64 width = 0.;
  13. };
  14. void PaintOutlineSegments(
  15. QPainter &p,
  16. QRectF ellipse,
  17. const std::vector<OutlineSegment> &segments,
  18. float64 fromFullProgress = 1.);
  19. void PaintOutlineSegments(
  20. QPainter &p,
  21. QRectF rect,
  22. float64 radius,
  23. const std::vector<OutlineSegment> &segments);
  24. [[nodiscard]] QLinearGradient UnreadStoryOutlineGradient(QRectF rect = {});
  25. } // namespace Ui