2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Implement folder link add / join design.

This commit is contained in:
John Preston
2023-03-29 17:23:21 +04:00
parent 7684dbc701
commit 0faadc8fa0
10 changed files with 725 additions and 113 deletions

View File

@@ -224,9 +224,20 @@ rpl::producer<> DefaultOverlayWidgetHelper::controlsActivations() {
}
rpl::producer<bool> DefaultOverlayWidgetHelper::controlsSideRightValue() {
return Ui::Platform::TitleControlsLayoutValue() | rpl::map([=] {
return _controls->controls.geometry().center().x()
> _controls->wrap.geometry().center().x();
using namespace Ui::Platform;
return TitleControlsLayoutValue(
) | rpl::map([=](const TitleControls::Layout &layout) {
// See TitleControls::updateControlsPosition.
if (ranges::contains(layout.left, TitleControl::Close)) {
return false;
} else if (ranges::contains(layout.right, TitleControl::Close)) {
return true;
} else if (layout.left.size() > layout.right.size()) {
return false;
} else {
return true;
}
}) | rpl::distinct_until_changed();
}