From cc4055a5e392e831465e2a7d98d49252932bd16f Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 21 Feb 2021 06:48:32 +0300 Subject: [PATCH] Added method to Window::Controller to show custom layer widget. --- Telegram/SourceFiles/window/window_controller.cpp | 7 +++++++ Telegram/SourceFiles/window/window_controller.h | 4 ++++ Telegram/SourceFiles/window/window_session_controller.cpp | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/window/window_controller.cpp b/Telegram/SourceFiles/window/window_controller.cpp index bd23b329ae..f9d352f642 100644 --- a/Telegram/SourceFiles/window/window_controller.cpp +++ b/Telegram/SourceFiles/window/window_controller.cpp @@ -277,6 +277,13 @@ void Controller::showToast(const QString &text) { Ui::Toast::Show(_widget.bodyWidget(), text); } +void Controller::showLayer( + std::unique_ptr &&layer, + Ui::LayerOptions options, + anim::type animated) { + _widget.showLayer(std::move(layer), options, animated); +} + void Controller::showBox( object_ptr content, Ui::LayerOptions options, diff --git a/Telegram/SourceFiles/window/window_controller.h b/Telegram/SourceFiles/window/window_controller.h index 1b20e7e0ab..f58dc8e770 100644 --- a/Telegram/SourceFiles/window/window_controller.h +++ b/Telegram/SourceFiles/window/window_controller.h @@ -69,6 +69,10 @@ public: return result; } void showToast(const QString &text); + void showLayer( + std::unique_ptr &&layer, + Ui::LayerOptions options, + anim::type animated = anim::type::normal); void showRightColumn(object_ptr widget); void sideBarChanged(); diff --git a/Telegram/SourceFiles/window/window_session_controller.cpp b/Telegram/SourceFiles/window/window_session_controller.cpp index 8a24b2ce74..6f256c8b4c 100644 --- a/Telegram/SourceFiles/window/window_session_controller.cpp +++ b/Telegram/SourceFiles/window/window_session_controller.cpp @@ -1206,7 +1206,7 @@ void SessionController::showLayer( std::unique_ptr &&layer, Ui::LayerOptions options, anim::type animated) { - widget()->showLayer(std::move(layer), options, animated); + _window->showLayer(std::move(layer), options, animated); } void SessionController::removeLayerBlackout() {