diff --git a/Telegram/SourceFiles/calls/calls_panel.cpp b/Telegram/SourceFiles/calls/calls_panel.cpp index 89315a328..ba59a72f9 100644 --- a/Telegram/SourceFiles/calls/calls_panel.cpp +++ b/Telegram/SourceFiles/calls/calls_panel.cpp @@ -61,8 +61,8 @@ Panel::Panel(not_null call) , _user(call->user()) , _layerBg(std::make_unique(widget())) #ifndef Q_OS_MAC -, _controls(std::make_unique( - widget(), +, _controls(Ui::Platform::SetupSeparateTitleControls( + window(), st::callTitle, [=](bool maximized) { toggleFullScreen(maximized); })) #endif // !Q_OS_MAC @@ -144,7 +144,7 @@ void Panel::initWindow() { return Flag::None | Flag(0); } #ifndef Q_OS_MAC - if (_controls->geometry().contains(widgetPoint)) { + if (_controls->controls.geometry().contains(widgetPoint)) { return Flag::None | Flag(0); } #endif // !Q_OS_MAC @@ -550,7 +550,7 @@ void Panel::initLayout() { }, widget()->lifetime()); #ifndef Q_OS_MAC - _controls->raise(); + _controls->wrap.raise(); #endif // !Q_OS_MAC } @@ -628,7 +628,7 @@ void Panel::updateControlsGeometry() { } if (_fingerprint) { #ifndef Q_OS_MAC - const auto controlsGeometry = _controls->geometry(); + const auto controlsGeometry = _controls->controls.geometry(); const auto halfWidth = widget()->width() / 2; const auto minLeft = (controlsGeometry.center().x() < halfWidth) ? (controlsGeometry.width() + st::callFingerprintTop) diff --git a/Telegram/SourceFiles/calls/calls_panel.h b/Telegram/SourceFiles/calls/calls_panel.h index adff466b9..f06fc7185 100644 --- a/Telegram/SourceFiles/calls/calls_panel.h +++ b/Telegram/SourceFiles/calls/calls_panel.h @@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/weak_ptr.h" #include "base/timer.h" #include "base/object_ptr.h" +#include "base/unique_qptr.h" #include "calls/calls_call.h" #include "calls/group/ui/desktop_capture_choose_source.h" #include "ui/effects/animations.h" @@ -37,7 +38,7 @@ namespace GL { enum class Backend; } // namespace GL namespace Platform { -class TitleControls; +struct SeparateTitleControls; } // namespace Platform } // namespace Ui @@ -126,7 +127,7 @@ private: std::unique_ptr _incoming; #ifndef Q_OS_MAC - std::unique_ptr _controls; + std::unique_ptr _controls; #endif // !Q_OS_MAC QSize _incomingFrameSize; diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp index f0248ed7d..e35b9c23c 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp @@ -88,8 +88,8 @@ Panel::Panel(not_null call) , _peer(call->peer()) , _layerBg(std::make_unique(widget())) #ifndef Q_OS_MAC -, _controls(std::make_unique( - widget(), +, _controls(Ui::Platform::SetupSeparateTitleControls( + window(), st::groupCallTitle)) #endif // !Q_OS_MAC , _viewport( @@ -302,7 +302,7 @@ void Panel::initWidget() { updateControlsGeometry(); } - // title geometry depends on _controls->geometry, + // title geometry depends on _controls->controls.geometry, // which is not updated here yet. crl::on_main(widget(), [=] { refreshTitle(); }); }, lifetime()); @@ -1368,7 +1368,7 @@ void Panel::initLayout() { initGeometry(); #ifndef Q_OS_MAC - _controls->raise(); + _controls->wrap.raise(); Ui::Platform::TitleControlsLayoutChanged( ) | rpl::start_with_next([=] { @@ -1413,7 +1413,7 @@ QRect Panel::computeTitleRect() const { #ifdef Q_OS_MAC return QRect(70, 0, width - remove - 70, 28); #else // Q_OS_MAC - const auto controls = _controls->geometry(); + const auto controls = _controls->controls.geometry(); const auto right = controls.x() + controls.width() + skip; return (controls.center().x() < width / 2) ? QRect(right, 0, width - right - remove, controls.height()) @@ -1884,7 +1884,8 @@ void Panel::updateControlsGeometry() { #ifdef Q_OS_MAC const auto controlsOnTheLeft = true; #else // Q_OS_MAC - const auto controlsOnTheLeft = _controls->geometry().center().x() + const auto center = _controls->controls.geometry().center(); + const auto controlsOnTheLeft = center.x() < widget()->width() / 2; #endif // Q_OS_MAC const auto menux = st::groupCallMenuTogglePosition.x(); diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.h b/Telegram/SourceFiles/calls/group/calls_group_panel.h index 49ea11efa..04f895280 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.h +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.h @@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/timer.h" #include "base/flags.h" #include "base/object_ptr.h" +#include "base/unique_qptr.h" #include "calls/group/calls_group_call.h" #include "calls/group/calls_group_common.h" #include "calls/group/calls_choose_join_as.h" @@ -51,7 +52,7 @@ namespace Toast { class Instance; } // namespace Toast namespace Platform { -class TitleControls; +struct SeparateTitleControls; } // namespace Platform } // namespace Ui @@ -194,7 +195,7 @@ private: rpl::variable _mode; #ifndef Q_OS_MAC - std::unique_ptr _controls; + std::unique_ptr _controls; #endif // !Q_OS_MAC rpl::lifetime _callLifetime; diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 64fa3d83b..d5d2ccb46 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 64fa3d83b5fa70394dd7c0a023ae3c8c9e809d8c +Subproject commit d5d2ccb4677c8d86c33d628699ed86bb9c8fc948