27 : KCModule(parent, data)
30 OverviewConfig::instance(KWIN_CONFIG);
31 addConfig(OverviewConfig::self(), widget());
33 auto actionCollection =
new KActionCollection(
this, QStringLiteral(
"kwin"));
35 actionCollection->setComponentDisplayName(i18n(
"KWin"));
36 actionCollection->setConfigGroup(QStringLiteral(
"Overview"));
37 actionCollection->setConfigGlobal(
true);
39 QAction *cycleAction = actionCollection->addAction(QStringLiteral(
"Cycle Overview"));
40 cycleAction->setText(i18nc(
"@action Overview and Grid View are the name of KWin effects",
"Cycle through Overview and Grid View"));
41 cycleAction->setProperty(
"isConfigurationAction",
true);
42 KGlobalAccel::self()->setDefaultShortcut(cycleAction, {});
43 KGlobalAccel::self()->setShortcut(cycleAction, {});
45 QAction *reverseCycleAction = actionCollection->addAction(QStringLiteral(
"Cycle Overview Opposite"));
46 reverseCycleAction->setText(i18nc(
"@action Grid View and Overview are the name of KWin effects",
"Cycle through Grid View and Overview"));
47 reverseCycleAction->setProperty(
"isConfigurationAction",
true);
48 KGlobalAccel::self()->setDefaultShortcut(reverseCycleAction, {});
49 KGlobalAccel::self()->setShortcut(reverseCycleAction, {});
51 const QKeySequence defaultOverviewShortcut = Qt::META | Qt::Key_W;
52 QAction *overviewAction = actionCollection->addAction(QStringLiteral(
"Overview"));
53 overviewAction->setText(i18nc(
"@action Overview is the name of a KWin effect",
"Toggle Overview"));
54 overviewAction->setProperty(
"isConfigurationAction",
true);
55 KGlobalAccel::self()->setDefaultShortcut(overviewAction, {defaultOverviewShortcut});
56 KGlobalAccel::self()->setShortcut(overviewAction, {defaultOverviewShortcut});
58 const QKeySequence defaultGridShortcut = Qt::META | Qt::Key_G;
59 QAction *gridAction = actionCollection->addAction(QStringLiteral(
"Grid View"));
60 gridAction->setText(i18nc(
"@action Grid View is the name of a KWin effect",
"Toggle Grid View"));
61 gridAction->setProperty(
"isConfigurationAction",
true);
62 KGlobalAccel::self()->setDefaultShortcut(gridAction, {defaultGridShortcut});
63 KGlobalAccel::self()->setShortcut(gridAction, {defaultGridShortcut});
65 ui.shortcutsEditor->addCollection(actionCollection);
66 connect(ui.shortcutsEditor, &KShortcutsEditor::keyChange,
this, &KCModule::markAsChanged);