mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-08 16:13:56 +02:00
Fixed swipe-back on strip of similar channels.
This commit is contained in:
parent
d369d988b0
commit
8f409a8fe2
1 changed files with 20 additions and 3 deletions
|
@ -529,7 +529,8 @@ void HistoryInner::setupSwipeReplyAndBack() {
|
||||||
}
|
}
|
||||||
const auto peer = _peer;
|
const auto peer = _peer;
|
||||||
|
|
||||||
auto update = [=, history = _history](Ui::Controls::SwipeContextData data) {
|
auto update = [=, history = _history](
|
||||||
|
Ui::Controls::SwipeContextData data) {
|
||||||
if (data.translation > 0) {
|
if (data.translation > 0) {
|
||||||
if (!_swipeBackData.callback) {
|
if (!_swipeBackData.callback) {
|
||||||
_swipeBackData = Ui::Controls::SetupSwipeBack(
|
_swipeBackData = Ui::Controls::SetupSwipeBack(
|
||||||
|
@ -565,9 +566,24 @@ void HistoryInner::setupSwipeReplyAndBack() {
|
||||||
int cursorTop,
|
int cursorTop,
|
||||||
Qt::LayoutDirection direction) {
|
Qt::LayoutDirection direction) {
|
||||||
if (direction == Qt::RightToLeft) {
|
if (direction == Qt::RightToLeft) {
|
||||||
return Ui::Controls::DefaultSwipeBackHandlerFinishData([=] {
|
auto good = true;
|
||||||
_controller->showBackFromStack();
|
enumerateItems<EnumItemsDirection::BottomToTop>([&](
|
||||||
|
not_null<Element*> view,
|
||||||
|
int itemtop,
|
||||||
|
int itembottom) {
|
||||||
|
if (view->data()->showSimilarChannels()) {
|
||||||
|
good = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
|
if (good) {
|
||||||
|
return Ui::Controls::DefaultSwipeBackHandlerFinishData([=] {
|
||||||
|
_controller->showBackFromStack();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return Ui::Controls::SwipeHandlerFinishData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
auto result = Ui::Controls::SwipeHandlerFinishData();
|
auto result = Ui::Controls::SwipeHandlerFinishData();
|
||||||
if (inSelectionMode().inSelectionMode
|
if (inSelectionMode().inSelectionMode
|
||||||
|
@ -581,6 +597,7 @@ void HistoryInner::setupSwipeReplyAndBack() {
|
||||||
if ((cursorTop < itemtop)
|
if ((cursorTop < itemtop)
|
||||||
|| (cursorTop > itembottom)
|
|| (cursorTop > itembottom)
|
||||||
|| !view->data()->isRegular()
|
|| !view->data()->isRegular()
|
||||||
|
|| view->data()->showSimilarChannels()
|
||||||
|| view->data()->isService()) {
|
|| view->data()->isService()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue