mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Adapt to TitleControlsLayout change
This commit is contained in:
parent
73b3f7e298
commit
bf26de495a
3 changed files with 5 additions and 6 deletions
|
@ -1612,7 +1612,7 @@ void Panel::initLayout() {
|
||||||
#ifndef Q_OS_MAC
|
#ifndef Q_OS_MAC
|
||||||
_controls->wrap.raise();
|
_controls->wrap.raise();
|
||||||
|
|
||||||
Ui::Platform::TitleControlsLayoutChanged(
|
_controls->controls.layout().changes(
|
||||||
) | rpl::start_with_next([=] {
|
) | rpl::start_with_next([=] {
|
||||||
// _menuToggle geometry depends on _controls arrangement.
|
// _menuToggle geometry depends on _controls arrangement.
|
||||||
crl::on_main(widget(), [=] { updateControlsGeometry(); });
|
crl::on_main(widget(), [=] { updateControlsGeometry(); });
|
||||||
|
|
|
@ -1259,7 +1259,8 @@ void Pip::setupButtons() {
|
||||||
rect.y(),
|
rect.y(),
|
||||||
volumeToggleWidth,
|
volumeToggleWidth,
|
||||||
volumeToggleHeight);
|
volumeToggleHeight);
|
||||||
if (!Ui::Platform::TitleControlsLayout().onLeft()) {
|
using Ui::Platform::TitleControlsLayout;
|
||||||
|
if (!TitleControlsLayout::Create()->current().onLeft()) {
|
||||||
_close.area.moveLeft(rect.x()
|
_close.area.moveLeft(rect.x()
|
||||||
+ rect.width()
|
+ rect.width()
|
||||||
- (_close.area.x() - rect.x())
|
- (_close.area.x() - rect.x())
|
||||||
|
|
|
@ -224,10 +224,8 @@ rpl::producer<> DefaultOverlayWidgetHelper::controlsActivations() {
|
||||||
}
|
}
|
||||||
|
|
||||||
rpl::producer<bool> DefaultOverlayWidgetHelper::controlsSideRightValue() {
|
rpl::producer<bool> DefaultOverlayWidgetHelper::controlsSideRightValue() {
|
||||||
using namespace Ui::Platform;
|
return _controls->controls.layout().value(
|
||||||
|
) | rpl::map([=](const auto &layout) {
|
||||||
return TitleControlsLayoutValue(
|
|
||||||
) | rpl::map([=](const TitleControls::Layout &layout) {
|
|
||||||
return !layout.onLeft();
|
return !layout.onLeft();
|
||||||
}) | rpl::distinct_until_changed();
|
}) | rpl::distinct_until_changed();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue