Skip to content

Commit

Permalink
Adapt to TitleControlsLayout change
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed Dec 19, 2024
1 parent 73b3f7e commit bf26de4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/calls/group/calls_group_panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(); });
Expand Down
3 changes: 2 additions & 1 deletion Telegram/SourceFiles/media/view/media_view_pip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
6 changes: 2 additions & 4 deletions Telegram/SourceFiles/platform/platform_overlay_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,8 @@ rpl::producer<> DefaultOverlayWidgetHelper::controlsActivations() {
}

rpl::producer<bool> 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();
}
Expand Down

0 comments on commit bf26de4

Please sign in to comment.