participants_check_view.h 896 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. #include "ui/widgets/checkbox.h"
  9. namespace Ui {
  10. class ParticipantsCheckView : public Ui::AbstractCheckView {
  11. public:
  12. ParticipantsCheckView(
  13. int count,
  14. int duration,
  15. bool checked,
  16. Fn<void()> updateCallback);
  17. [[nodiscard]] static QSize ComputeSize(int count);
  18. QSize getSize() const override;
  19. void paint(QPainter &p, int left, int top, int outerWidth) override;
  20. QImage prepareRippleMask() const override;
  21. bool checkRippleStartPosition(QPoint position) const override;
  22. ~ParticipantsCheckView();
  23. private:
  24. const QString _text;
  25. const int _count;
  26. void checkedChangedHook(anim::type animated) override;
  27. };
  28. } // namespace Ui