From bf7aae5fc623681cc61681e8206e299c36540a71 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 25 Jun 2020 18:17:37 +0400 Subject: [PATCH] Allow float video player across accounts. --- .../chat_helpers/tabbed_section.cpp | 8 ++-- .../SourceFiles/chat_helpers/tabbed_section.h | 4 +- .../chat_helpers/tabbed_selector.cpp | 4 +- .../chat_helpers/tabbed_selector.h | 4 +- Telegram/SourceFiles/core/application.cpp | 39 ++++++++++++++++ Telegram/SourceFiles/core/application.h | 17 +++++++ .../SourceFiles/dialogs/dialogs_widget.cpp | 6 +-- Telegram/SourceFiles/dialogs/dialogs_widget.h | 4 +- .../view/export_view_panel_controller.cpp | 5 ++- .../admin_log/history_admin_log_inner.cpp | 2 +- .../admin_log/history_admin_log_section.cpp | 4 +- .../admin_log/history_admin_log_section.h | 4 +- .../SourceFiles/history/history_widget.cpp | 13 +++--- Telegram/SourceFiles/history/history_widget.h | 4 +- .../history/view/history_view_list_widget.cpp | 2 +- .../view/history_view_scheduled_section.cpp | 4 +- .../view/history_view_scheduled_section.h | 4 +- .../SourceFiles/info/info_content_widget.cpp | 4 +- .../SourceFiles/info/info_content_widget.h | 4 +- .../SourceFiles/info/info_layer_widget.cpp | 17 +++---- Telegram/SourceFiles/info/info_layer_widget.h | 5 +-- .../SourceFiles/info/info_section_widget.cpp | 8 ++-- .../SourceFiles/info/info_section_widget.h | 4 +- .../SourceFiles/info/info_wrap_widget.cpp | 8 ++-- Telegram/SourceFiles/info/info_wrap_widget.h | 4 +- Telegram/SourceFiles/intro/intro_widget.cpp | 44 ++++++++++++++++++- Telegram/SourceFiles/intro/intro_widget.h | 24 +++++++++- Telegram/SourceFiles/mainwidget.cpp | 26 +++++------ Telegram/SourceFiles/mainwidget.h | 14 +++--- Telegram/SourceFiles/mainwindow.cpp | 11 ++--- Telegram/SourceFiles/mainwindow.h | 1 - .../media/player/media_player_float.cpp | 21 ++++----- .../media/player/media_player_float.h | 22 +++++++--- .../media/player/media_player_instance.cpp | 7 +++ .../media/player/media_player_instance.h | 3 +- Telegram/SourceFiles/window/section_widget.h | 10 +---- .../window/window_session_controller.cpp | 44 +++++-------------- .../window/window_session_controller.h | 24 +--------- 38 files changed, 257 insertions(+), 176 deletions(-) diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_section.cpp b/Telegram/SourceFiles/chat_helpers/tabbed_section.cpp index 00480179a..3759697e3 100644 --- a/Telegram/SourceFiles/chat_helpers/tabbed_section.cpp +++ b/Telegram/SourceFiles/chat_helpers/tabbed_section.cpp @@ -61,12 +61,12 @@ bool TabbedSection::showInternal( return false; } -bool TabbedSection::wheelEventFromFloatPlayer(QEvent *e) { - return _selector->wheelEventFromFloatPlayer(e); +bool TabbedSection::floatPlayerHandleWheelEvent(QEvent *e) { + return _selector->floatPlayerHandleWheelEvent(e); } -QRect TabbedSection::rectForFloatPlayer() const { - return _selector->rectForFloatPlayer(); +QRect TabbedSection::floatPlayerAvailableRect() { + return _selector->floatPlayerAvailableRect(); } TabbedSection::~TabbedSection() { diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_section.h b/Telegram/SourceFiles/chat_helpers/tabbed_section.h index a93202fd1..0d32197ad 100644 --- a/Telegram/SourceFiles/chat_helpers/tabbed_section.h +++ b/Telegram/SourceFiles/chat_helpers/tabbed_section.h @@ -44,8 +44,8 @@ public: return true; } // Float player interface. - bool wheelEventFromFloatPlayer(QEvent *e) override; - QRect rectForFloatPlayer() const override; + bool floatPlayerHandleWheelEvent(QEvent *e) override; + QRect floatPlayerAvailableRect() override; ~TabbedSection(); diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp b/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp index bf85f6962..045b28d99 100644 --- a/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp +++ b/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp @@ -608,11 +608,11 @@ QImage TabbedSelector::grabForAnimation() { return result; } -bool TabbedSelector::wheelEventFromFloatPlayer(QEvent *e) { +bool TabbedSelector::floatPlayerHandleWheelEvent(QEvent *e) { return _scroll->viewportEvent(e); } -QRect TabbedSelector::rectForFloatPlayer() const { +QRect TabbedSelector::floatPlayerAvailableRect() const { return mapToGlobal(_scroll->geometry()); } diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_selector.h b/Telegram/SourceFiles/chat_helpers/tabbed_selector.h index 5e2305c21..0b3bfd305 100644 --- a/Telegram/SourceFiles/chat_helpers/tabbed_selector.h +++ b/Telegram/SourceFiles/chat_helpers/tabbed_selector.h @@ -98,8 +98,8 @@ public: } // Float player interface. - bool wheelEventFromFloatPlayer(QEvent *e); - QRect rectForFloatPlayer() const; + bool floatPlayerHandleWheelEvent(QEvent *e); + QRect floatPlayerAvailableRect() const; auto showRequests() const { return _showRequests.events(); diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp index 2e04dd2e6..c709b98ac 100644 --- a/Telegram/SourceFiles/core/application.cpp +++ b/Telegram/SourceFiles/core/application.cpp @@ -46,6 +46,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "media/audio/media_audio.h" #include "media/audio/media_audio_track.h" #include "media/player/media_player_instance.h" +#include "media/player/media_player_float.h" #include "media/clip/media_clip_reader.h" // For Media::Clip::Finish(). #include "window/notifications_manager.h" #include "window/themes/window_theme.h" @@ -512,6 +513,44 @@ void Application::startEmojiImageLoader() { }, _lifetime); } +void Application::setDefaultFloatPlayerDelegate( + not_null delegate) { + Expects(!_defaultFloatPlayerDelegate == !_floatPlayers); + + _defaultFloatPlayerDelegate = delegate; + _replacementFloatPlayerDelegate = nullptr; + if (_floatPlayers) { + _floatPlayers->replaceDelegate(delegate); + } else { + _floatPlayers = std::make_unique( + delegate); + } +} + +void Application::replaceFloatPlayerDelegate( + not_null replacement) { + Expects(_floatPlayers != nullptr); + + _replacementFloatPlayerDelegate = replacement; + _floatPlayers->replaceDelegate(replacement); +} + +void Application::restoreFloatPlayerDelegate( + not_null replacement) { + Expects(_floatPlayers != nullptr); + + if (_replacementFloatPlayerDelegate == replacement) { + _replacementFloatPlayerDelegate = nullptr; + _floatPlayers->replaceDelegate(_defaultFloatPlayerDelegate); + } +} + +rpl::producer Application::floatPlayerClosed() const { + Expects(_floatPlayers != nullptr); + + return _floatPlayers->closeEvents(); +} + void Application::logout(Main::Account *account) { if (account) { account->logOut(); diff --git a/Telegram/SourceFiles/core/application.h b/Telegram/SourceFiles/core/application.h index 44aecddde..ce61b5ad1 100644 --- a/Telegram/SourceFiles/core/application.h +++ b/Telegram/SourceFiles/core/application.h @@ -71,6 +71,10 @@ class Instance; namespace View { class OverlayWidget; } // namespace View +namespace Player { +class FloatController; +class FloatDelegate; +} // namespace Player } // namespace Media namespace Lang { @@ -218,6 +222,15 @@ public: bool openLocalUrl(const QString &url, QVariant context); bool openInternalUrl(const QString &url, QVariant context); + // Float player. + void setDefaultFloatPlayerDelegate( + not_null delegate); + void replaceFloatPlayerDelegate( + not_null replacement); + void restoreFloatPlayerDelegate( + not_null replacement); + [[nodiscard]] rpl::producer floatPlayerClosed() const; + void logout(Main::Account *account = nullptr); void forceLogOut( not_null account, @@ -320,6 +333,10 @@ private: const std::unique_ptr _audio; + std::unique_ptr _floatPlayers; + Media::Player::FloatDelegate *_defaultFloatPlayerDelegate = nullptr; + Media::Player::FloatDelegate *_replacementFloatPlayerDelegate = nullptr; + // Notifications should be destroyed before _audio. // Mutable because is created in run() after OpenSSL is inited. std::unique_ptr _notifications; diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp index 88bbd51c1..51da21c0f 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp @@ -671,11 +671,11 @@ void Widget::startSlideAnimation() { _a_show.start([=] { animationCallback(); }, 0., 1., st::slideDuration, Window::SlideAnimation::transition()); } -bool Widget::wheelEventFromFloatPlayer(QEvent *e) { +bool Widget::floatPlayerHandleWheelEvent(QEvent *e) { return _scroll->viewportEvent(e); } -QRect Widget::rectForFloatPlayer() const { +QRect Widget::floatPlayerAvailableRect() { return mapToGlobal(_scroll->geometry()); } @@ -1596,7 +1596,7 @@ void Widget::updateControlsGeometry() { _scroll->setGeometry(0, scrollTop, width(), scrollHeight); _inner->resize(width(), _inner->height()); if (scrollHeight != wasScrollHeight) { - controller()->floatPlayerAreaUpdated().notify(true); + controller()->floatPlayerAreaUpdated(); } if (_topDelta) { _scroll->scrollToY(newScrollTop); diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.h b/Telegram/SourceFiles/dialogs/dialogs_widget.h index 8b4d3eda5..51f8ab38b 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.h +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.h @@ -83,8 +83,8 @@ public: void onSearchMore(); // Float player interface. - bool wheelEventFromFloatPlayer(QEvent *e) override; - QRect rectForFloatPlayer() const override; + bool floatPlayerHandleWheelEvent(QEvent *e) override; + QRect floatPlayerAvailableRect() override; ~Widget(); diff --git a/Telegram/SourceFiles/export/view/export_view_panel_controller.cpp b/Telegram/SourceFiles/export/view/export_view_panel_controller.cpp index 30a337242..b91fa15d5 100644 --- a/Telegram/SourceFiles/export/view/export_view_panel_controller.cpp +++ b/Telegram/SourceFiles/export/view/export_view_panel_controller.cpp @@ -52,10 +52,11 @@ void SuggestBox::prepare() { setTitle(tr::lng_export_suggest_title()); addButton(tr::lng_box_ok(), [=] { + const auto session = _session; closeBox(); Core::App().exportManager().start( - _session, - _session->local().readExportSettings().singlePeer); + session, + session->local().readExportSettings().singlePeer); }); addButton(tr::lng_export_suggest_cancel(), [=] { closeBox(); }); setCloseByOutsideClick(false); diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp index 72f47e020..0fe9f6d00 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp @@ -326,7 +326,7 @@ void InnerWidget::visibleTopBottomUpdated( } else { scrollDateHideByTimer(); } - _controller->floatPlayerAreaUpdated().notify(true); + _controller->floatPlayerAreaUpdated(); } void InnerWidget::updateVisibleTopItem() { diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_section.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_section.cpp index fb44bd988..351c2e59a 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_section.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_section.cpp @@ -453,11 +453,11 @@ void Widget::showFinishedHook() { _fixedBar->setAnimatingMode(false); } -bool Widget::wheelEventFromFloatPlayer(QEvent *e) { +bool Widget::floatPlayerHandleWheelEvent(QEvent *e) { return _scroll->viewportEvent(e); } -QRect Widget::rectForFloatPlayer() const { +QRect Widget::floatPlayerAvailableRect() { return mapToGlobal(_scroll->geometry()); } diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_section.h b/Telegram/SourceFiles/history/admin_log/history_admin_log_section.h index 33a1b06c7..0bd28fb9b 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_section.h +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_section.h @@ -64,8 +64,8 @@ public: void setInternalState(const QRect &geometry, not_null memento); // Float player interface. - bool wheelEventFromFloatPlayer(QEvent *e) override; - QRect rectForFloatPlayer() const override; + bool floatPlayerHandleWheelEvent(QEvent *e) override; + QRect floatPlayerAvailableRect() override; void applyFilter(FilterValue &&value); diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 77fc7cedc..6b5822206 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -2011,6 +2011,7 @@ void HistoryWidget::showHistory( FullMsgId(_history->channelId(), _showAtMsgId) }); } update(); + controller()->floatPlayerAreaUpdated(); crl::on_main(App::wnd(), [] { App::wnd()->setInnerFocus(); }); } @@ -2889,7 +2890,7 @@ void HistoryWidget::visibleAreaUpdated() { const auto scrollTop = _scroll->scrollTop(); const auto scrollBottom = scrollTop + _scroll->height(); _list->visibleAreaUpdated(scrollTop, scrollBottom); - controller()->floatPlayerAreaUpdated().notify(true); + controller()->floatPlayerAreaUpdated(); } } @@ -3846,12 +3847,12 @@ bool HistoryWidget::eventFilter(QObject *obj, QEvent *e) { return TWidget::eventFilter(obj, e); } -bool HistoryWidget::wheelEventFromFloatPlayer(QEvent *e) { - return _scroll->viewportEvent(e); +bool HistoryWidget::floatPlayerHandleWheelEvent(QEvent *e) { + return _peer ? _scroll->viewportEvent(e) : false; } -QRect HistoryWidget::rectForFloatPlayer() const { - return mapToGlobal(_scroll->geometry()); +QRect HistoryWidget::floatPlayerAvailableRect() { + return _peer ? mapToGlobal(_scroll->geometry()) : mapToGlobal(rect()); } void HistoryWidget::updateDragAreas() { @@ -5116,7 +5117,7 @@ void HistoryWidget::updateHistoryGeometry( } } - controller()->floatPlayerAreaUpdated().notify(true); + controller()->floatPlayerAreaUpdated(); } updateListSize(); diff --git a/Telegram/SourceFiles/history/history_widget.h b/Telegram/SourceFiles/history/history_widget.h index dc80a5e3e..fd299a56a 100644 --- a/Telegram/SourceFiles/history/history_widget.h +++ b/Telegram/SourceFiles/history/history_widget.h @@ -264,8 +264,8 @@ public: bool returnTabbedSelector() override; // Float player interface. - bool wheelEventFromFloatPlayer(QEvent *e) override; - QRect rectForFloatPlayer() const override; + bool floatPlayerHandleWheelEvent(QEvent *e) override; + QRect floatPlayerAvailableRect() override; void app_sendBotCallback( not_null button, diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index ee3ff1e2b..f38a42067 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -602,7 +602,7 @@ void ListWidget::visibleTopBottomUpdated( } else { scrollDateHideByTimer(); } - _controller->floatPlayerAreaUpdated().notify(true); + _controller->floatPlayerAreaUpdated(); _applyUpdatedScrollState.call(); } diff --git a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp index ae3223a01..c4710aec6 100644 --- a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp @@ -882,11 +882,11 @@ void ScheduledWidget::showFinishedHook() { _composeControls->showFinished(); } -bool ScheduledWidget::wheelEventFromFloatPlayer(QEvent *e) { +bool ScheduledWidget::floatPlayerHandleWheelEvent(QEvent *e) { return _scroll->viewportEvent(e); } -QRect ScheduledWidget::rectForFloatPlayer() const { +QRect ScheduledWidget::floatPlayerAvailableRect() { return mapToGlobal(_scroll->geometry()); } diff --git a/Telegram/SourceFiles/history/view/history_view_scheduled_section.h b/Telegram/SourceFiles/history/view/history_view_scheduled_section.h index 124b7acef..c4a25db07 100644 --- a/Telegram/SourceFiles/history/view/history_view_scheduled_section.h +++ b/Telegram/SourceFiles/history/view/history_view_scheduled_section.h @@ -84,8 +84,8 @@ public: bool returnTabbedSelector() override; // Float player interface. - bool wheelEventFromFloatPlayer(QEvent *e) override; - QRect rectForFloatPlayer() const override; + bool floatPlayerHandleWheelEvent(QEvent *e) override; + QRect floatPlayerAvailableRect() override; // ListDelegate interface. Context listContext() override; diff --git a/Telegram/SourceFiles/info/info_content_widget.cpp b/Telegram/SourceFiles/info/info_content_widget.cpp index 47cbea464..832c04533 100644 --- a/Telegram/SourceFiles/info/info_content_widget.cpp +++ b/Telegram/SourceFiles/info/info_content_widget.cpp @@ -214,11 +214,11 @@ void ContentWidget::scrollTo(const Ui::ScrollToRequest &request) { _scroll->scrollTo(request); } -bool ContentWidget::wheelEventFromFloatPlayer(QEvent *e) { +bool ContentWidget::floatPlayerHandleWheelEvent(QEvent *e) { return _scroll->viewportEvent(e); } -QRect ContentWidget::rectForFloatPlayer() const { +QRect ContentWidget::floatPlayerAvailableRect() const { return mapToGlobal(_scroll->geometry()); } diff --git a/Telegram/SourceFiles/info/info_content_widget.h b/Telegram/SourceFiles/info/info_content_widget.h index bcfa01169..9d2a5f423 100644 --- a/Telegram/SourceFiles/info/info_content_widget.h +++ b/Telegram/SourceFiles/info/info_content_widget.h @@ -62,8 +62,8 @@ public: rpl::producer scrollTillBottomChanges() const; // Float player interface. - bool wheelEventFromFloatPlayer(QEvent *e); - QRect rectForFloatPlayer() const; + bool floatPlayerHandleWheelEvent(QEvent *e); + QRect floatPlayerAvailableRect() const; virtual rpl::producer selectedListValue() const; virtual void cancelSelection() { diff --git a/Telegram/SourceFiles/info/info_layer_widget.cpp b/Telegram/SourceFiles/info/info_layer_widget.cpp index 36ddb750d..cd062dbc7 100644 --- a/Telegram/SourceFiles/info/info_layer_widget.cpp +++ b/Telegram/SourceFiles/info/info_layer_widget.cpp @@ -18,6 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "window/main_window.h" #include "main/main_session.h" #include "boxes/abstract_box.h" +#include "core/application.h" #include "app.h" #include "styles/style_info.h" #include "styles/style_window.h" @@ -31,7 +32,7 @@ LayerWidget::LayerWidget( : _controller(controller) , _content(this, controller, Wrap::Layer, memento) { setupHeightConsumers(); - _controller->replaceFloatPlayerDelegate(floatPlayerDelegate()); + Core::App().replaceFloatPlayerDelegate(floatPlayerDelegate()); } LayerWidget::LayerWidget( @@ -40,7 +41,7 @@ LayerWidget::LayerWidget( : _controller(controller) , _content(memento->takeContent(this, Wrap::Layer)) { setupHeightConsumers(); - _controller->replaceFloatPlayerDelegate(floatPlayerDelegate()); + Core::App().replaceFloatPlayerDelegate(floatPlayerDelegate()); } auto LayerWidget::floatPlayerDelegate() @@ -52,19 +53,15 @@ not_null LayerWidget::floatPlayerWidget() { return this; } -not_null LayerWidget::floatPlayerController() { - return _controller; -} - -not_null LayerWidget::floatPlayerGetSection( - Window::Column column) { +auto LayerWidget::floatPlayerGetSection(Window::Column column) +-> not_null<::Media::Player::FloatSectionDelegate*> { Expects(_content != nullptr); return _content; } void LayerWidget::floatPlayerEnumerateSections(Fn widget, + not_null<::Media::Player::FloatSectionDelegate*> widget, Window::Column widgetColumn)> callback) { Expects(_content != nullptr); @@ -285,7 +282,7 @@ void LayerWidget::paintEvent(QPaintEvent *e) { void LayerWidget::restoreFloatPlayerDelegate() { if (!_floatPlayerDelegateRestored) { _floatPlayerDelegateRestored = true; - _controller->restoreFloatPlayerDelegate(floatPlayerDelegate()); + Core::App().restoreFloatPlayerDelegate(floatPlayerDelegate()); } } diff --git a/Telegram/SourceFiles/info/info_layer_widget.h b/Telegram/SourceFiles/info/info_layer_widget.h index db6edc1ac..79b4d247f 100644 --- a/Telegram/SourceFiles/info/info_layer_widget.h +++ b/Telegram/SourceFiles/info/info_layer_widget.h @@ -58,11 +58,10 @@ private: void restoreFloatPlayerDelegate(); not_null<::Media::Player::FloatDelegate*> floatPlayerDelegate(); not_null floatPlayerWidget() override; - not_null floatPlayerController() override; - not_null floatPlayerGetSection( + not_null<::Media::Player::FloatSectionDelegate*> floatPlayerGetSection( Window::Column column) override; void floatPlayerEnumerateSections(Fn widget, + not_null<::Media::Player::FloatSectionDelegate*> widget, Window::Column widgetColumn)> callback) override; bool floatPlayerIsVisible(not_null item) override; diff --git a/Telegram/SourceFiles/info/info_section_widget.cpp b/Telegram/SourceFiles/info/info_section_widget.cpp index 08c59fc5a..b679bcc7c 100644 --- a/Telegram/SourceFiles/info/info_section_widget.cpp +++ b/Telegram/SourceFiles/info/info_section_widget.cpp @@ -108,12 +108,12 @@ object_ptr SectionWidget::moveContentToLayer( bodyGeometry); } -bool SectionWidget::wheelEventFromFloatPlayer(QEvent *e) { - return _content->wheelEventFromFloatPlayer(e); +bool SectionWidget::floatPlayerHandleWheelEvent(QEvent *e) { + return _content->floatPlayerHandleWheelEvent(e); } -QRect SectionWidget::rectForFloatPlayer() const { - return _content->rectForFloatPlayer(); +QRect SectionWidget::floatPlayerAvailableRect() { + return _content->floatPlayerAvailableRect(); } } // namespace Info diff --git a/Telegram/SourceFiles/info/info_section_widget.h b/Telegram/SourceFiles/info/info_section_widget.h index 1ca552569..79d5cf7e0 100644 --- a/Telegram/SourceFiles/info/info_section_widget.h +++ b/Telegram/SourceFiles/info/info_section_widget.h @@ -54,8 +54,8 @@ public: QRect bodyGeometry) override; // Float player interface. - bool wheelEventFromFloatPlayer(QEvent *e) override; - QRect rectForFloatPlayer() const override; + bool floatPlayerHandleWheelEvent(QEvent *e) override; + QRect floatPlayerAvailableRect() override; protected: void doSetInnerFocus() override; diff --git a/Telegram/SourceFiles/info/info_wrap_widget.cpp b/Telegram/SourceFiles/info/info_wrap_widget.cpp index 73192e0dc..c56ac00ac 100644 --- a/Telegram/SourceFiles/info/info_wrap_widget.cpp +++ b/Telegram/SourceFiles/info/info_wrap_widget.cpp @@ -1026,12 +1026,12 @@ void WrapWidget::updateContentGeometry() { } } -bool WrapWidget::wheelEventFromFloatPlayer(QEvent *e) { - return _content->wheelEventFromFloatPlayer(e); +bool WrapWidget::floatPlayerHandleWheelEvent(QEvent *e) { + return _content->floatPlayerHandleWheelEvent(e); } -QRect WrapWidget::rectForFloatPlayer() const { - return _content->rectForFloatPlayer(); +QRect WrapWidget::floatPlayerAvailableRect() { + return _content->floatPlayerAvailableRect(); } object_ptr WrapWidget::createTopBarSurrogate( diff --git a/Telegram/SourceFiles/info/info_wrap_widget.h b/Telegram/SourceFiles/info/info_wrap_widget.h index 45c4c909e..13929ded2 100644 --- a/Telegram/SourceFiles/info/info_wrap_widget.h +++ b/Telegram/SourceFiles/info/info_wrap_widget.h @@ -108,8 +108,8 @@ public: void updateInternalState(not_null memento); // Float player interface. - bool wheelEventFromFloatPlayer(QEvent *e) override; - QRect rectForFloatPlayer() const override; + bool floatPlayerHandleWheelEvent(QEvent *e) override; + QRect floatPlayerAvailableRect() override; object_ptr createTopBarSurrogate(QWidget *parent); diff --git a/Telegram/SourceFiles/intro/intro_widget.cpp b/Telegram/SourceFiles/intro/intro_widget.cpp index 6c93d7524..abe077692 100644 --- a/Telegram/SourceFiles/intro/intro_widget.cpp +++ b/Telegram/SourceFiles/intro/intro_widget.cpp @@ -29,6 +29,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "mtproto/mtproto_dc_options.h" #include "window/window_slide_animation.h" #include "window/window_connecting_widget.h" +#include "window/section_widget.h" #include "base/platform/base_platform_info.h" #include "api/api_text_entities.h" #include "app.h" @@ -62,6 +63,8 @@ Widget::Widget( this, account, rpl::single(true))) { + Core::App().setDefaultFloatPlayerDelegate(floatPlayerDelegate()); + switch (point) { case EnterPoint::Start: appendStep(new StartWidget(this, _account, getData())); @@ -130,6 +133,42 @@ Widget::Widget( } } +not_null Widget::floatPlayerDelegate() { + return static_cast(this); +} + +auto Widget::floatPlayerSectionDelegate() +-> not_null { + return static_cast(this); +} + +not_null Widget::floatPlayerWidget() { + return this; +} + +auto Widget::floatPlayerGetSection(Window::Column column) +-> not_null { + return this; +} + +void Widget::floatPlayerEnumerateSections(Fn widget, + Window::Column widgetColumn)> callback) { + callback(this, Window::Column::Second); +} + +bool Widget::floatPlayerIsVisible(not_null item) { + return false; +} + +QRect Widget::floatPlayerAvailableRect() { + return mapToGlobal(rect()); +} + +bool Widget::floatPlayerHandleWheelEvent(QEvent *e) { + return false; +} + void Widget::refreshLang() { _changeLanguage.destroy(); createLanguageLink(); @@ -310,6 +349,7 @@ void Widget::fixOrder() { if (_changeLanguage) _changeLanguage->raise(); _settings->raise(); _back->raise(); + floatPlayerRaiseAll(); _connecting->raise(); } @@ -610,8 +650,10 @@ void Widget::showAnimated(const QPixmap &bgAnimCache, bool back) { _a_show.stop(); showControls(); + floatPlayerHideAll(); (_showBack ? _cacheUnder : _cacheOver) = Ui::GrabWidget(this); hideControls(); + floatPlayerShowVisible(); _a_show.start( [=] { animationCallback(); }, @@ -665,6 +707,7 @@ void Widget::resizeEvent(QResizeEvent *e) { } updateControlsGeometry(); + floatPlayerAreaUpdated(); } void Widget::updateControlsGeometry() { @@ -732,7 +775,6 @@ Widget::~Widget() { for (auto step : base::take(_stepHistory)) { delete step; } - if (App::wnd()) App::wnd()->noIntro(this); } } // namespace Intro diff --git a/Telegram/SourceFiles/intro/intro_widget.h b/Telegram/SourceFiles/intro/intro_widget.h index c4b618eb4..5cfffa2f1 100644 --- a/Telegram/SourceFiles/intro/intro_widget.h +++ b/Telegram/SourceFiles/intro/intro_widget.h @@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/effects/animations.h" #include "window/window_lock_widgets.h" #include "core/core_cloud_password.h" +#include "media/player/media_player_float.h" namespace Main { class Account; @@ -83,7 +84,11 @@ enum class EnterPoint : uchar { Qr, }; -class Widget : public Ui::RpWidget, private base::Subscriber { +class Widget + : public Ui::RpWidget + , private Media::Player::FloatDelegate + , private Media::Player::FloatSectionDelegate + , private base::Subscriber { public: Widget( QWidget *parent, @@ -143,6 +148,23 @@ private: void getNearestDC(); void showTerms(Fn callback); + // FloatDelegate + [[nodiscard]] auto floatPlayerDelegate() + -> not_null; + [[nodiscard]] auto floatPlayerSectionDelegate() + -> not_null; + not_null floatPlayerWidget() override; + not_null floatPlayerGetSection( + Window::Column column) override; + void floatPlayerEnumerateSections(Fn widget, + Window::Column widgetColumn)> callback) override; + bool floatPlayerIsVisible(not_null item) override; + + // FloatSectionDelegate + QRect floatPlayerAvailableRect() override; + bool floatPlayerHandleWheelEvent(QEvent *e) override; + const not_null _account; std::optional _api; diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index f181494e3..2cfdd45e9 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -239,12 +239,6 @@ MainWidget::MainWidget( , _cacheBackgroundTimer([=] { cacheBackground(); }) , _viewsIncrementTimer([=] { viewsIncrement(); }) , _changelogs(Core::Changelogs::Create(&controller->session())) { - _controller->setDefaultFloatPlayerDelegate(floatPlayerDelegate()); - _controller->floatPlayerClosed( - ) | rpl::start_with_next([=](FullMsgId itemId) { - floatPlayerClosed(itemId); - }, lifetime()); - updateScrollColors(); setupConnectingWidget(); @@ -255,6 +249,12 @@ MainWidget::MainWidget( setCurrentCall(call); }); + Core::App().setDefaultFloatPlayerDelegate(floatPlayerDelegate()); + Core::App().floatPlayerClosed( + ) | rpl::start_with_next([=](FullMsgId itemId) { + floatPlayerClosed(itemId); + }, lifetime()); + Core::App().exportManager().currentView( ) | rpl::start_with_next([=](Export::View::PanelController *view) { setCurrentExportView(view); @@ -396,12 +396,8 @@ not_null MainWidget::floatPlayerWidget() { return this; } -not_null MainWidget::floatPlayerController() { - return _controller; -} - -not_null MainWidget::floatPlayerGetSection( - Window::Column column) { +auto MainWidget::floatPlayerGetSection(Window::Column column) +-> not_null { if (Adaptive::ThreeColumn()) { if (column == Window::Column::First) { return _dialogs; @@ -432,7 +428,7 @@ not_null MainWidget::floatPlayerGetSection( } void MainWidget::floatPlayerEnumerateSections(Fn widget, + not_null widget, Window::Column widgetColumn)> callback) { if (Adaptive::ThreeColumn()) { callback(_dialogs, Window::Column::First); @@ -1967,8 +1963,10 @@ void MainWidget::showAnimated(const QPixmap &bgAnimCache, bool back) { _a_show.stop(); showAll(); + floatPlayerHideAll(); (_showBack ? _cacheUnder : _cacheOver) = Ui::GrabWidget(this); hideAll(); + floatPlayerShowVisible(); _a_show.start( [this] { animationCallback(); }, @@ -2038,7 +2036,6 @@ void MainWidget::hideAll() { _player->setVisible(false); _playerHeight = 0; } - floatPlayerHideAll(); } void MainWidget::showAll() { @@ -2096,7 +2093,6 @@ void MainWidget::showAll() { } updateControlsGeometry(); floatPlayerCheckVisibility(); - floatPlayerShowVisible(); App::wnd()->checkHistoryActivation(); } diff --git a/Telegram/SourceFiles/mainwidget.h b/Telegram/SourceFiles/mainwidget.h index 622cdbf2a..c60732d3e 100644 --- a/Telegram/SourceFiles/mainwidget.h +++ b/Telegram/SourceFiles/mainwidget.h @@ -99,8 +99,8 @@ class ItemBase; class MainWidget : public Ui::RpWidget - , private base::Subscriber - , private Media::Player::FloatDelegate { + , private Media::Player::FloatDelegate + , private base::Subscriber { Q_OBJECT public: @@ -234,6 +234,8 @@ public: void notify_inlineKeyboardMoved(not_null item, int oldKeyboardTop, int newKeyboardTop); bool notify_switchInlineBotButtonReceived(const QString &query, UserData *samePeerBot, MsgId samePeerReplyTo); + using FloatDelegate::floatPlayerAreaUpdated; + void closeBothPlayers(); public slots: @@ -314,13 +316,13 @@ private: void cacheBackground(); void clearCachedBackground(); - not_null floatPlayerDelegate(); + [[nodiscard]] auto floatPlayerDelegate() + -> not_null; not_null floatPlayerWidget() override; - not_null floatPlayerController() override; - not_null floatPlayerGetSection( + not_null floatPlayerGetSection( Window::Column column) override; void floatPlayerEnumerateSections(Fn widget, + not_null widget, Window::Column widgetColumn)> callback) override; bool floatPlayerIsVisible(not_null item) override; void floatPlayerClosed(FullMsgId itemId); diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index 6b1119a69..d5cc25630 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -262,8 +262,10 @@ void MainWindow::setupIntro(Intro::EnterPoint point) { auto animated = (_main || _passcodeLock); auto bg = animated ? grabInner() : QPixmap(); + destroyLayer(); + auto created = object_ptr(bodyWidget(), &account(), point); clearWidgets(); - _intro.create(bodyWidget(), &account(), point); + _intro = std::move(created); if (_passcodeLock) { _intro->hide(); } else { @@ -284,6 +286,7 @@ void MainWindow::setupMain() { auto animated = (_intro || _passcodeLock); auto bg = animated ? grabInner() : QPixmap(); + destroyLayer(); auto created = object_ptr(bodyWidget(), sessionController()); clearWidgets(); _main = std::move(created); @@ -711,12 +714,6 @@ void MainWindow::activate() { } } -void MainWindow::noIntro(Intro::Widget *was) { - if (was == _intro) { - _intro = nullptr; - } -} - bool MainWindow::takeThirdSectionFromLayer() { return _layer ? _layer->takeToThirdSection() : false; } diff --git a/Telegram/SourceFiles/mainwindow.h b/Telegram/SourceFiles/mainwindow.h index 33f0c69cc..15f3815f2 100644 --- a/Telegram/SourceFiles/mainwindow.h +++ b/Telegram/SourceFiles/mainwindow.h @@ -59,7 +59,6 @@ public: void activate(); - void noIntro(Intro::Widget *was); bool takeThirdSectionFromLayer(); void checkHistoryActivation(); diff --git a/Telegram/SourceFiles/media/player/media_player_float.cpp b/Telegram/SourceFiles/media/player/media_player_float.cpp index 698169dfe..0cae66312 100644 --- a/Telegram/SourceFiles/media/player/media_player_float.cpp +++ b/Telegram/SourceFiles/media/player/media_player_float.cpp @@ -286,12 +286,7 @@ FloatController::Item::Item( FloatController::FloatController(not_null delegate) : _delegate(delegate) -, _parent(_delegate->floatPlayerWidget()) -, _controller(_delegate->floatPlayerController()) { - subscribe(_controller->floatPlayerAreaUpdated(), [=] { - checkVisibility(); - }); - +, _parent(_delegate->floatPlayerWidget()) { subscribe(Media::Player::instance()->trackChangedNotifier(), [=]( AudioMsgId::Type type) { if (type == AudioMsgId::Type::Voice) { @@ -347,6 +342,11 @@ void FloatController::startDelegateHandling() { const FloatDelegate::FloatPlayerFilterWheelEventRequest &request) { *request.result = filterWheelEvent(request.object, request.event); }, _delegateLifetime); + + _delegate->floatPlayerAreaUpdates( + ) | rpl::start_with_next([=] { + checkVisibility(); + }, _delegateLifetime); } void FloatController::checkCurrent() { @@ -457,7 +457,7 @@ std::optional FloatController::filterWheelEvent( if (instance->widget == object) { const auto section = _delegate->floatPlayerGetSection( instance->column); - return section->wheelEventFromFloatPlayer(event); + return section->floatPlayerHandleWheelEvent(event); } } return std::nullopt; @@ -517,7 +517,7 @@ QPoint FloatController::getHiddenPosition( QPoint FloatController::getPosition(not_null instance) const { const auto section = _delegate->floatPlayerGetSection(instance->column); - const auto rect = section->rectForFloatPlayer(); + const auto rect = section->floatPlayerAvailableRect(); auto position = rect.topLeft(); if (IsBottomCorner(instance->corner)) { position.setY(position.y() + rect.height() - instance->widget->height()); @@ -566,9 +566,10 @@ void FloatController::updateColumnCorner(QPoint center) { auto column = Core::App().settings().floatPlayerColumn(); auto corner = Core::App().settings().floatPlayerCorner(); auto checkSection = [&]( - not_null widget, + not_null widget, Window::Column widgetColumn) { - auto rect = _parent->mapFromGlobal(widget->rectForFloatPlayer()); + auto rect = _parent->mapFromGlobal( + widget->floatPlayerAvailableRect()); auto left = rect.x() + (size.width() / 2); auto right = rect.x() + rect.width() - (size.width() / 2); auto top = rect.y() + (size.height() / 2); diff --git a/Telegram/SourceFiles/media/player/media_player_float.h b/Telegram/SourceFiles/media/player/media_player_float.h index 51fbffff1..731e54bb7 100644 --- a/Telegram/SourceFiles/media/player/media_player_float.h +++ b/Telegram/SourceFiles/media/player/media_player_float.h @@ -14,7 +14,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Window { class SessionController; -class AbstractSectionWidget; enum class Column; } // namespace Window @@ -105,14 +104,19 @@ private: }; +class FloatSectionDelegate { +public: + virtual QRect floatPlayerAvailableRect() = 0; + virtual bool floatPlayerHandleWheelEvent(QEvent *e) = 0; +}; + class FloatDelegate { public: virtual not_null floatPlayerWidget() = 0; - virtual not_null floatPlayerController() = 0; - virtual not_null floatPlayerGetSection( + virtual not_null floatPlayerGetSection( Window::Column column) = 0; virtual void floatPlayerEnumerateSections(Fn widget, + not_null widget, Window::Column widgetColumn)> callback) = 0; virtual bool floatPlayerIsVisible(not_null item) = 0; @@ -129,7 +133,10 @@ public: return _raiseAll.events(); } virtual rpl::producer<> floatPlayerUpdatePositionsRequests() { - return _updatePositions.events();; + return _updatePositions.events(); + } + virtual rpl::producer<> floatPlayerAreaUpdates() { + return _areaUpdates.events(); } struct FloatPlayerFilterWheelEventRequest { @@ -160,6 +167,9 @@ protected: void floatPlayerUpdatePositions() { _updatePositions.fire({}); } + void floatPlayerAreaUpdated() { + _areaUpdates.fire({}); + } std::optional floatPlayerFilterWheelEvent( not_null object, not_null event) { @@ -174,6 +184,7 @@ private: rpl::event_stream<> _showVisible; rpl::event_stream<> _raiseAll; rpl::event_stream<> _updatePositions; + rpl::event_stream<> _areaUpdates; rpl::event_stream _filterWheelEvent; }; @@ -240,7 +251,6 @@ private: not_null _delegate; not_null _parent; - not_null _controller; std::vector> _items; rpl::event_stream _closeEvents; diff --git a/Telegram/SourceFiles/media/player/media_player_instance.cpp b/Telegram/SourceFiles/media/player/media_player_instance.cpp index 3b5a294c2..c9a734013 100644 --- a/Telegram/SourceFiles/media/player/media_player_instance.cpp +++ b/Telegram/SourceFiles/media/player/media_player_instance.cpp @@ -228,6 +228,8 @@ void Instance::clearStreamed(not_null data, bool savePosition) { requestRoundVideoResize(); emitUpdate(data->type); data->streamed = nullptr; + + _roundPlaying = false; App::wnd()->sessionController()->disableGifPauseReason( Window::GifPauseReason::RoundPlaying); } @@ -729,6 +731,10 @@ void Instance::setupShortcuts() { }, _lifetime); } +bool Instance::pauseGifByRoundVideo() const { + return _roundPlaying; +} + void Instance::handleStreamingUpdate( not_null data, Streaming::Update &&update) { @@ -741,6 +747,7 @@ void Instance::handleStreamingUpdate( float64) { requestRoundVideoRepaint(); }); + _roundPlaying = true; App::wnd()->sessionController()->enableGifPauseReason( Window::GifPauseReason::RoundPlaying); requestRoundVideoResize(); diff --git a/Telegram/SourceFiles/media/player/media_player_instance.h b/Telegram/SourceFiles/media/player/media_player_instance.h index a5d74c6f4..6f11484d1 100644 --- a/Telegram/SourceFiles/media/player/media_player_instance.h +++ b/Telegram/SourceFiles/media/player/media_player_instance.h @@ -158,6 +158,7 @@ public: return _updatedNotifier.events(); } + bool pauseGifByRoundVideo() const; void documentLoadProgress(DocumentData *document); @@ -254,12 +255,12 @@ private: void requestRoundVideoResize() const; void requestRoundVideoRepaint() const; - void setHistory(not_null data, History *history); void setSession(not_null data, Main::Session *session); Data _songData; Data _voiceData; + bool _roundPlaying = false; base::Observable _switchToNextNotifier; base::Observable _playerWidgetOver; diff --git a/Telegram/SourceFiles/window/section_widget.h b/Telegram/SourceFiles/window/section_widget.h index fd5a33e3a..f5a88e8eb 100644 --- a/Telegram/SourceFiles/window/section_widget.h +++ b/Telegram/SourceFiles/window/section_widget.h @@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/rp_widget.h" #include "dialogs/dialogs_key.h" +#include "media/player/media_player_float.h" // FloatSectionDelegate #include "base/object_ptr.h" namespace Main { @@ -34,6 +35,7 @@ enum class Column { class AbstractSectionWidget : public Ui::RpWidget + , public Media::Player::FloatSectionDelegate , protected base::Subscriber { public: AbstractSectionWidget( @@ -58,14 +60,6 @@ public: return false; } - // Float player interface. - virtual bool wheelEventFromFloatPlayer(QEvent *e) { - return false; - } - [[nodiscard]] virtual QRect rectForFloatPlayer() const { - return mapToGlobal(rect()); - } - private: const not_null _controller; diff --git a/Telegram/SourceFiles/window/window_session_controller.cpp b/Telegram/SourceFiles/window/window_session_controller.cpp index 69e1d2aa5..5e051b6ee 100644 --- a/Telegram/SourceFiles/window/window_session_controller.cpp +++ b/Telegram/SourceFiles/window/window_session_controller.cpp @@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/history_item.h" #include "history/view/history_view_element.h" //#include "history/feed/history_feed_section.h" // #feed +#include "media/player/media_player_instance.h" #include "data/data_media_types.h" #include "data/data_session.h" #include "data/data_folder.h" @@ -128,6 +129,10 @@ SessionController::SessionController( this)) { init(); + if (Media::Player::instance()->pauseGifByRoundVideo()) { + enableGifPauseReason(GifPauseReason::RoundPlaying); + } + subscribe(session->api().fullPeerUpdated(), [=](PeerData *peer) { if (peer == _showEditPeer) { _showEditPeer = nullptr; @@ -414,6 +419,12 @@ bool SessionController::isGifPausedAtLeastFor(GifPauseReason reason) const { return (static_cast(_gifPauseReasons) >= 2 * static_cast(reason)) || !widget()->isActive(); } +void SessionController::floatPlayerAreaUpdated() { + if (const auto main = widget()->sessionContent()) { + main->floatPlayerAreaUpdated(); + } +} + int SessionController::dialogsSmallColumnWidth() const { return st::dialogsPadding.x() + st::dialogsPhotoSize + st::dialogsPadding.x(); } @@ -781,39 +792,6 @@ not_null SessionController::content() const { return widget()->sessionContent(); } -void SessionController::setDefaultFloatPlayerDelegate( - not_null delegate) { - Expects(_defaultFloatPlayerDelegate == nullptr); - - _defaultFloatPlayerDelegate = delegate; - _floatPlayers = std::make_unique( - delegate); -} - -void SessionController::replaceFloatPlayerDelegate( - not_null replacement) { - Expects(_floatPlayers != nullptr); - - _replacementFloatPlayerDelegate = replacement; - _floatPlayers->replaceDelegate(replacement); -} - -void SessionController::restoreFloatPlayerDelegate( - not_null replacement) { - Expects(_floatPlayers != nullptr); - - if (_replacementFloatPlayerDelegate == replacement) { - _replacementFloatPlayerDelegate = nullptr; - _floatPlayers->replaceDelegate(_defaultFloatPlayerDelegate); - } -} - -rpl::producer SessionController::floatPlayerClosed() const { - Expects(_floatPlayers != nullptr); - - return _floatPlayers->closeEvents(); -} - int SessionController::filtersWidth() const { return _filters ? st::windowFiltersWidth : 0; } diff --git a/Telegram/SourceFiles/window/window_session_controller.h b/Telegram/SourceFiles/window/window_session_controller.h index bd2544027..6078f8f09 100644 --- a/Telegram/SourceFiles/window/window_session_controller.h +++ b/Telegram/SourceFiles/window/window_session_controller.h @@ -37,13 +37,6 @@ namespace Settings { enum class Type; } // namespace Settings -namespace Media { -namespace Player { -class FloatController; -class FloatDelegate; -} // namespace Player -} // namespace Media - namespace Passport { struct FormRequest; class FormController; @@ -208,9 +201,7 @@ public: return _gifPauseLevelChanged; } bool isGifPausedAtLeastFor(GifPauseReason reason) const; - base::Observable &floatPlayerAreaUpdated() { - return _floatPlayerAreaUpdated; - } + void floatPlayerAreaUpdated(); struct ColumnLayout { int bodyWidth; @@ -289,14 +280,6 @@ public: return this; } - void setDefaultFloatPlayerDelegate( - not_null delegate); - void replaceFloatPlayerDelegate( - not_null replacement); - void restoreFloatPlayerDelegate( - not_null replacement); - rpl::producer floatPlayerClosed() const; - [[nodiscard]] int filtersWidth() const; [[nodiscard]] rpl::producer activeChatsFilter() const; [[nodiscard]] FilterId activeChatsFilterCurrent() const; @@ -342,7 +325,6 @@ private: GifPauseReasons _gifPauseReasons = 0; base::Observable _gifPauseLevelChanged; - base::Observable _floatPlayerAreaUpdated; // Depends on _gifPause*. const std::unique_ptr _tabbedSelector; @@ -355,10 +337,6 @@ private: rpl::variable _activeChatsFilter; - std::unique_ptr _floatPlayers; - Media::Player::FloatDelegate *_defaultFloatPlayerDelegate = nullptr; - Media::Player::FloatDelegate *_replacementFloatPlayerDelegate = nullptr; - PeerData *_showEditPeer = nullptr; rpl::variable _openedFolder;