Allow more Info sections swipe-back.

This commit is contained in:
John Preston
2025-03-12 18:01:47 +04:00
parent 31cb2f1999
commit fd718dfd5c
4 changed files with 14 additions and 19 deletions
@@ -404,24 +404,14 @@ void ContentWidget::setupSwipeReply() {
_swipeBackData = {};
}
}, [=](int, Qt::LayoutDirection direction) {
const auto can = [&] {
using Type = Section::Type;
if (direction != Qt::RightToLeft) {
return false;
} else if (_controller->wrap() == Wrap::Side) {
return (_controller->section().type() != Type::Profile);
} else if (_controller->wrap() == Wrap::Narrow) {
return true;
} else {
return false;
}
}();
return !can
? Ui::Controls::SwipeHandlerFinishData()
: Ui::Controls::DefaultSwipeBackHandlerFinishData([=] {
_controller->showBackFromStack();
});
return (direction == Qt::RightToLeft && _controller->hasBackButton())
? Ui::Controls::DefaultSwipeBackHandlerFinishData([=] {
checkBeforeClose(crl::guard(this, [=] {
_controller->parentController()->hideLayer();
_controller->showBackFromStack();
}));
})
: Ui::Controls::SwipeHandlerFinishData();
}, nullptr);
}