From 5ffc307ca8126845ce632df2216690085268c743 Mon Sep 17 00:00:00 2001 From: Jan Blackquill Date: Tue, 8 Mar 2022 14:49:39 +0000 Subject: [PATCH] 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 --- src/effects/desktopgrid/desktopgrid.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/effects/desktopgrid/desktopgrid.cpp b/src/effects/desktopgrid/desktopgrid.cpp index 0828b89e37..be6534f4ad 100644 --- a/src/effects/desktopgrid/desktopgrid.cpp +++ b/src/effects/desktopgrid/desktopgrid.cpp @@ -93,6 +93,13 @@ DesktopGridEffect::DesktopGridEffect() timeline.setCurrentTime(timeline.duration() * cb); 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, []() { effects->addRepaintFull(); });