Allowed swipe-to-back in side info section.

This commit is contained in:
23rd 2025-02-18 19:51:27 +03:00 committed by John Preston
parent 6bed3f3f09
commit ad64e068db

View file

@ -404,11 +404,22 @@ void ContentWidget::setupSwipeReply() {
_swipeBackData = {}; _swipeBackData = {};
} }
}, [=](int, Qt::LayoutDirection direction) { }, [=](int, Qt::LayoutDirection direction) {
if (_controller->wrap() != Wrap::Narrow const auto can = [&] {
|| direction != Qt::RightToLeft) { using Type = Section::Type;
return HistoryView::SwipeHandlerFinishData(); 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 HistoryView::DefaultSwipeBackHandlerFinishData([=] { }();
return !can
? HistoryView::SwipeHandlerFinishData()
: HistoryView::DefaultSwipeBackHandlerFinishData([=] {
_controller->showBackFromStack(); _controller->showBackFromStack();
}); });
}, nullptr); }, nullptr);