overlay_widget_mac.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 "platform/platform_overlay_widget.h"
  9. template <typename Object>
  10. class object_ptr;
  11. namespace Ui {
  12. class AbstractButton;
  13. } // namespace Ui
  14. namespace Ui::Platform {
  15. enum class TitleControl;
  16. } // namespace Ui::Platform
  17. namespace Platform {
  18. class MacOverlayWidgetHelper final : public OverlayWidgetHelper {
  19. public:
  20. MacOverlayWidgetHelper(
  21. not_null<Ui::RpWindow*> window,
  22. Fn<void(bool)> maximize);
  23. ~MacOverlayWidgetHelper();
  24. void beforeShow(bool fullscreen) override;
  25. void afterShow(bool fullscreen) override;
  26. void notifyFileDialogShown(bool shown) override;
  27. void minimize(not_null<Ui::RpWindow*> window) override;
  28. void clearState() override;
  29. void setControlsOpacity(float64 opacity) override;
  30. rpl::producer<bool> controlsSideRightValue() override;
  31. rpl::producer<int> topNotchSkipValue() override;
  32. private:
  33. using Control = Ui::Platform::TitleControl;
  34. struct Data;
  35. void activate(Control control);
  36. void resolveNative();
  37. void updateStyles(bool fullscreen);
  38. void refreshButtons(bool fullscreen);
  39. object_ptr<Ui::AbstractButton> create(
  40. not_null<QWidget*> parent,
  41. Control control);
  42. std::unique_ptr<Data> _data;
  43. };
  44. } // namespace Platform