Adapt to TitleControlsLayout change

This commit is contained in:
Ilya Fedin 2024-12-19 14:44:04 +04:00 committed by John Preston
parent 73b3f7e298
commit bf26de495a
3 changed files with 5 additions and 6 deletions

View file

@ -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(); });

View file

@ -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())

View file

@ -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();
}