effects/desktopgrid: register down gesture

Now you can close the desktop grid with the inverse
of the gesture you used to open it.

BUG: 444694
FIXED-IN: 5.24.4
This commit is contained in:
Jan Blackquill 2022-03-08 14:49:39 +00:00 committed by Nate Graham
parent 1b7173e927
commit 5ffc307ca8

View file

@ -93,6 +93,13 @@ DesktopGridEffect::DesktopGridEffect()
timeline.setCurrentTime(timeline.duration() * cb); timeline.setCurrentTime(timeline.duration() * cb);
effects->addRepaintFull(); effects->addRepaintFull();
}); });
effects->registerRealtimeTouchpadSwipeShortcut(SwipeDirection::Down, a, [this](qreal cb) {
if (!activated) return;
timeline.setDirection(QTimeLine::Backward);
timeline.setCurrentTime(timeline.duration() - (timeline.duration() * cb));
effects->addRepaintFull();
});
connect(&timeline, &QTimeLine::frameChanged, this, []() { connect(&timeline, &QTimeLine::frameChanged, this, []() {
effects->addRepaintFull(); effects->addRepaintFull();
}); });