abstract_box.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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_layer_widget.h"
  9. class Painter;
  10. namespace style {
  11. struct RoundButton;
  12. struct IconButton;
  13. struct ScrollArea;
  14. } // namespace style
  15. namespace Ui {
  16. class RoundButton;
  17. class IconButton;
  18. class ScrollArea;
  19. class FlatLabel;
  20. class FadeShadow;
  21. } // namespace Ui
  22. // Legacy global method.
  23. namespace Ui {
  24. namespace internal {
  25. void showBox(
  26. object_ptr<BoxContent> content,
  27. Ui::LayerOptions options,
  28. anim::type animated);
  29. } // namespace internal
  30. template <typename BoxType>
  31. QPointer<BoxType> show(
  32. object_ptr<BoxType> content,
  33. Ui::LayerOptions options = Ui::LayerOption::CloseOther,
  34. anim::type animated = anim::type::normal) {
  35. auto result = QPointer<BoxType>(content.data());
  36. internal::showBox(std::move(content), options, animated);
  37. return result;
  38. }
  39. void hideLayer(anim::type animated = anim::type::normal);
  40. } // namespace Ui