30 , m_shutdownTimer(new QTimer(this))
39 m_transitionState->
stop();
50 m_searchText = QString();
58 m_transitionState->
stop();
68 m_overviewState->
stop();
83 m_searchText = QString();
85 m_overviewState->
stop();
95 m_transitionState->
stop();
110 m_desktopOffset = QPointF(0, 0);
114 m_desktopOffset = QPointF(0, 0);
118 m_shutdownTimer->setSingleShot(
true);
119 connect(m_shutdownTimer, &QTimer::timeout,
this, &OverviewEffect::realDeactivate);
121 auto cycleAction =
new QAction(
this);
122 connect(cycleAction, &QAction::triggered,
this, &OverviewEffect::cycle);
123 cycleAction->setObjectName(QStringLiteral(
"Cycle Overview"));
124 cycleAction->setText(i18nc(
"@action Grid View and Overview are the name of KWin effects",
"Cycle through Overview and Grid View"));
125 KGlobalAccel::self()->setDefaultShortcut(cycleAction, {});
126 KGlobalAccel::self()->setShortcut(cycleAction, {});
127 m_cycleShortcut = KGlobalAccel::self()->shortcut(cycleAction);
129 auto reverseCycleAction =
new QAction(
this);
130 connect(reverseCycleAction, &QAction::triggered,
this, &OverviewEffect::reverseCycle);
131 reverseCycleAction->setObjectName(QStringLiteral(
"Cycle Overview Opposite"));
132 reverseCycleAction->setText(i18nc(
"@action Grid View and Overview are the name of KWin effects",
"Cycle through Grid View and Overview"));
133 KGlobalAccel::self()->setDefaultShortcut(reverseCycleAction, {});
134 KGlobalAccel::self()->setShortcut(reverseCycleAction, {});
135 m_reverseCycleShortcut = KGlobalAccel::self()->shortcut(reverseCycleAction);
137 const QKeySequence defaultOverviewShortcut = Qt::META | Qt::Key_W;
139 overviewAction->setObjectName(QStringLiteral(
"Overview"));
140 overviewAction->setText(i18nc(
"@action Overview is the name of a Kwin effect",
"Toggle Overview"));
141 KGlobalAccel::self()->setDefaultShortcut(overviewAction, {defaultOverviewShortcut});
142 KGlobalAccel::self()->setShortcut(overviewAction, {defaultOverviewShortcut});
143 m_overviewShortcut = KGlobalAccel::self()->shortcut(overviewAction);
145 const QKeySequence defaultGridShortcut = Qt::META | Qt::Key_G;
147 gridAction->setObjectName(QStringLiteral(
"Grid View"));
148 gridAction->setText(i18nc(
"@action Grid view is the name of a Kwin effect",
"Toggle Grid View"));
149 KGlobalAccel::self()->setDefaultShortcut(gridAction, {defaultGridShortcut});
150 KGlobalAccel::self()->setShortcut(gridAction, {defaultGridShortcut});
151 m_overviewShortcut = KGlobalAccel::self()->shortcut(gridAction);
161 qWarning() <<
"Failed to load overview:" << delegate->errorString();
164 delegate->loadUrl(QUrl(QStringLiteral(
"qrc:/overview/qml/main.qml")), QQmlComponent::Asynchronous);
339 if (m_cycleShortcut.contains(keyEvent->key() | keyEvent->modifiers())) {
340 if (keyEvent->type() == QEvent::KeyPress) {
345 if (m_reverseCycleShortcut.contains(keyEvent->key() | keyEvent->modifiers())) {
346 if (keyEvent->type() == QEvent::KeyPress) {
351 if (m_overviewShortcut.contains(keyEvent->key() | keyEvent->modifiers())) {
352 if (keyEvent->type() == QEvent::KeyPress) {
357 if (m_gridShortcut.contains(keyEvent->key() | keyEvent->modifiers())) {
358 if (keyEvent->type() == QEvent::KeyPress) {