From bf26de495a9b00be6bbb6616fc6ab598b10776a8 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 19 Dec 2024 14:44:04 +0400 Subject: [PATCH] Adapt to TitleControlsLayout change --- Telegram/SourceFiles/calls/group/calls_group_panel.cpp | 2 +- Telegram/SourceFiles/media/view/media_view_pip.cpp | 3 ++- Telegram/SourceFiles/platform/platform_overlay_widget.cpp | 6 ++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp index 1e2e29e1add7d8..4ae84ffcc662e8 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp @@ -1612,7 +1612,7 @@ void Panel::initLayout() { #ifndef Q_OS_MAC _controls->wrap.raise(); - Ui::Platform::TitleControlsLayoutChanged( + _controls->controls.layout().changes( ) | rpl::start_with_next([=] { // _menuToggle geometry depends on _controls arrangement. crl::on_main(widget(), [=] { updateControlsGeometry(); }); diff --git a/Telegram/SourceFiles/media/view/media_view_pip.cpp b/Telegram/SourceFiles/media/view/media_view_pip.cpp index 66ba74cd05aa06..159c8795fe81a4 100644 --- a/Telegram/SourceFiles/media/view/media_view_pip.cpp +++ b/Telegram/SourceFiles/media/view/media_view_pip.cpp @@ -1259,7 +1259,8 @@ void Pip::setupButtons() { rect.y(), volumeToggleWidth, volumeToggleHeight); - if (!Ui::Platform::TitleControlsLayout().onLeft()) { + using Ui::Platform::TitleControlsLayout; + if (!TitleControlsLayout::Create()->current().onLeft()) { _close.area.moveLeft(rect.x() + rect.width() - (_close.area.x() - rect.x()) diff --git a/Telegram/SourceFiles/platform/platform_overlay_widget.cpp b/Telegram/SourceFiles/platform/platform_overlay_widget.cpp index 32274eb6252f93..3e07e8b9711b56 100644 --- a/Telegram/SourceFiles/platform/platform_overlay_widget.cpp +++ b/Telegram/SourceFiles/platform/platform_overlay_widget.cpp @@ -224,10 +224,8 @@ rpl::producer<> DefaultOverlayWidgetHelper::controlsActivations() { } rpl::producer DefaultOverlayWidgetHelper::controlsSideRightValue() { - using namespace Ui::Platform; - - return TitleControlsLayoutValue( - ) | rpl::map([=](const TitleControls::Layout &layout) { + return _controls->controls.layout().value( + ) | rpl::map([=](const auto &layout) { return !layout.onLeft(); }) | rpl::distinct_until_changed(); }