tabbed_section.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 "window/section_widget.h"
  9. #include "window/section_memento.h"
  10. namespace ChatHelpers {
  11. class TabbedSelector;
  12. class TabbedMemento : public Window::SectionMemento {
  13. public:
  14. TabbedMemento() = default;
  15. TabbedMemento(TabbedMemento &&other) = default;
  16. TabbedMemento &operator=(TabbedMemento &&other) = default;
  17. object_ptr<Window::SectionWidget> createWidget(
  18. QWidget *parent,
  19. not_null<Window::SessionController*> controller,
  20. Window::Column column,
  21. const QRect &geometry) override;
  22. };
  23. class TabbedSection : public Window::SectionWidget {
  24. public:
  25. TabbedSection(
  26. QWidget *parent,
  27. not_null<Window::SessionController*> controller);
  28. void beforeHiding();
  29. void afterShown();
  30. bool showInternal(
  31. not_null<Window::SectionMemento*> memento,
  32. const Window::SectionShow &params) override;
  33. bool forceAnimateBack() const override {
  34. return true;
  35. }
  36. // Float player interface.
  37. bool floatPlayerHandleWheelEvent(QEvent *e) override;
  38. QRect floatPlayerAvailableRect() override;
  39. ~TabbedSection();
  40. protected:
  41. void resizeEvent(QResizeEvent *e) override;
  42. void showFinishedHook() override;
  43. private:
  44. const not_null<TabbedSelector*> _selector;
  45. };
  46. } // namespace ChatHelpers