Commit 6729380c authored by Eric Edlund's avatar Eric Edlund
Browse files

Make overview and present windows use realtime gestures

They still aren't realtime animated, but by making them respond to the
realtimeGesture() call, they can use callbacks to determine if they should be shown
or not. This allows you to swipe up, have it trigger, then swipe down in the same
motion and get it to untrigger without ever having to release.
parent a508a8c6
Pipeline #155110 passed with stage
in 23 minutes and 25 seconds
......@@ -39,7 +39,14 @@ OverviewEffect::OverviewEffect()
KGlobalAccel::self()->setShortcut(m_toggleAction, {defaultToggleShortcut});
m_toggleShortcut = KGlobalAccel::self()->shortcut(m_toggleAction);
effects->registerGlobalShortcut({defaultToggleShortcut}, m_toggleAction);
effects->registerTouchpadSwipeShortcut(SwipeDirection::Up, 4, m_toggleAction);
effects->registerRealtimeTouchpadSwipeShortcut(SwipeDirection::Up, 4, new QAction(), [this](qreal cb) { //m_toggleAction
if (cb > .2 && !isRunning()) {
activate();
}
if (cb <= .2 && isRunning()) {
deactivate();
}
});
connect(effects, &EffectsHandler::screenAboutToLock, this, &OverviewEffect::realDeactivate);
......
......@@ -82,7 +82,15 @@ PresentWindowsEffect::PresentWindowsEffect()
KGlobalAccel::self()->setShortcut(exposeAllAction, QList<QKeySequence>() << (Qt::CTRL | Qt::Key_F10) << Qt::Key_LaunchC);
shortcutAll = KGlobalAccel::self()->shortcut(exposeAllAction);
effects->registerGlobalShortcut(Qt::CTRL + Qt::Key_F10, exposeAllAction);
effects->registerTouchpadSwipeShortcut(SwipeDirection::Down, 4, exposeAllAction);
effects->registerRealtimeTouchpadSwipeShortcut(SwipeDirection::Down, 4, new QAction(), [this](qreal cb) { //exposeAllAction
m_mode = ModeAllDesktops;
if (cb > .2 && !m_activated) {
setActive(true);
}
if (cb < .2 && m_activated) {
setActive(false);
}
});
connect(exposeAllAction, &QAction::triggered, this, &PresentWindowsEffect::toggleActiveAllDesktops);
QAction* exposeClassAction = m_exposeClassAction;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment