jump_down_button.h 779 B

123456789101112131415161718192021222324252627282930313233343536
  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/buttons.h"
  9. namespace Ui {
  10. class JumpDownButton final : public RippleButton {
  11. public:
  12. JumpDownButton(QWidget *parent, const style::TwoIconButton &st);
  13. void setUnreadCount(int unreadCount);
  14. [[nodiscard]] int unreadCount() const {
  15. return _unreadCount;
  16. }
  17. protected:
  18. void paintEvent(QPaintEvent *e) override;
  19. QImage prepareRippleMask() const override;
  20. QPoint prepareRippleStartPosition() const override;
  21. private:
  22. const style::TwoIconButton &_st;
  23. int _unreadCount = 0;
  24. };
  25. } // namespace Ui