mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 06:55:58 +00:00
Replaced SetupSwipeHandler signature from arguments to struct.
This commit is contained in:
@@ -1051,8 +1051,7 @@ void MainMenu::setupSwipe() {
|
||||
});
|
||||
}
|
||||
|
||||
Ui::Controls::SetupSwipeHandler(_inner, _scroll.data(), [=](
|
||||
Ui::Controls::SwipeContextData data) {
|
||||
auto update = [=](Ui::Controls::SwipeContextData data) {
|
||||
if (data.translation < 0) {
|
||||
if (!_swipeBackData.callback) {
|
||||
_swipeBackData = Ui::Controls::SetupSwipeBack(
|
||||
@@ -1069,13 +1068,22 @@ void MainMenu::setupSwipe() {
|
||||
} else if (_swipeBackData.lifetime) {
|
||||
_swipeBackData = {};
|
||||
}
|
||||
}, [=](int, Qt::LayoutDirection direction) {
|
||||
};
|
||||
|
||||
auto init = [=](int, Qt::LayoutDirection direction) {
|
||||
if (direction != Qt::LeftToRight) {
|
||||
return Ui::Controls::SwipeHandlerFinishData();
|
||||
}
|
||||
return Ui::Controls::DefaultSwipeBackHandlerFinishData([=] {
|
||||
closeLayer();
|
||||
});
|
||||
};
|
||||
|
||||
Ui::Controls::SetupSwipeHandler({
|
||||
.widget = _inner,
|
||||
.scroll = _scroll.data(),
|
||||
.update = std::move(update),
|
||||
.init = std::move(init),
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user