max_invite_box.h 944 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/layers/box_content.h"
  9. class MaxInviteBox final : public Ui::BoxContent {
  10. public:
  11. MaxInviteBox(QWidget*, not_null<ChannelData*> channel);
  12. protected:
  13. void prepare() override;
  14. void paintEvent(QPaintEvent *e) override;
  15. void resizeEvent(QResizeEvent *e) override;
  16. void mouseMoveEvent(QMouseEvent *e) override;
  17. void mousePressEvent(QMouseEvent *e) override;
  18. void leaveEventHook(QEvent *e) override;
  19. private:
  20. void updateSelected(const QPoint &cursorGlobalPosition);
  21. not_null<ChannelData*> _channel;
  22. Ui::Text::String _text;
  23. int32 _textWidth, _textHeight;
  24. QRect _invitationLink;
  25. bool _linkOver = false;
  26. bool _creatingInviteLink = false;
  27. QPoint _lastMousePos;
  28. };