From 0f7b0c42272764f221be32da17ea810d278abf61 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 21 Feb 2022 01:40:22 +0300 Subject: [PATCH] Added ability to hide layer for specific window controller. --- Telegram/SourceFiles/window/window_session_controller.cpp | 4 ++++ Telegram/SourceFiles/window/window_session_controller.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Telegram/SourceFiles/window/window_session_controller.cpp b/Telegram/SourceFiles/window/window_session_controller.cpp index 33be820825..b6c66c8707 100644 --- a/Telegram/SourceFiles/window/window_session_controller.cpp +++ b/Telegram/SourceFiles/window/window_session_controller.cpp @@ -1515,6 +1515,10 @@ QPointer SessionController::show( return _window->show(std::move(content), options, animated); } +void SessionController::hideLayer(anim::type animated) { + show({ nullptr }, Ui::LayerOption::CloseOther, animated); +} + void SessionController::openPhoto( not_null photo, FullMsgId contextId) { diff --git a/Telegram/SourceFiles/window/window_session_controller.h b/Telegram/SourceFiles/window/window_session_controller.h index be44cf407b..b6abcdc62c 100644 --- a/Telegram/SourceFiles/window/window_session_controller.h +++ b/Telegram/SourceFiles/window/window_session_controller.h @@ -296,6 +296,8 @@ public: Ui::LayerOptions options = Ui::LayerOption::KeepOther, anim::type animated = anim::type::normal); + void hideLayer(anim::type animated = anim::type::normal); + [[nodiscard]] auto sendingAnimation() const -> Ui::MessageSendingAnimationController &; [[nodiscard]] auto tabbedSelector() const