profile_back_button.h 892 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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/abstract_button.h"
  9. namespace Main {
  10. class Session;
  11. } // namespace Main
  12. namespace Profile {
  13. class BackButton final : public Ui::AbstractButton {
  14. public:
  15. BackButton(
  16. QWidget *parent,
  17. not_null<Main::Session*> session,
  18. const QString &text,
  19. rpl::producer<bool> oneColumnValue);
  20. void setText(const QString &text);
  21. protected:
  22. void paintEvent(QPaintEvent *e) override;
  23. int resizeGetHeight(int newWidth) override;
  24. void onStateChanged(State was, StateChangeSource source) override;
  25. private:
  26. const not_null<Main::Session*> _session;
  27. rpl::lifetime _unreadBadgeLifetime;
  28. QString _text;
  29. };
  30. } // namespace Profile