plugins/showpaint: set default shortcut

This effects is off by default, which means to instruct someone how to
use it for debugging purposes, you need to both tell them to enable it,
and then also teach them how to assign a shortcut for it.

Since it's off by default, there's no harm in setting a shortcut, which
simplifies the enablement instructions. I've chosen Meta+Ctrl+Alt+P,
which uses so many modifiers that it won't conflict with anything.
wilder/Plasma/6.2
Nate Graham 2 years ago
parent 178d49093c
commit 68b7448847
  1. 4
      src/plugins/showpaint/showpaint.cpp
  2. 4
      src/plugins/showpaint/showpaint_config.cpp

@ -40,8 +40,8 @@ ShowPaintEffect::ShowPaintEffect()
auto *toggleAction = new QAction(this);
toggleAction->setObjectName(QStringLiteral("Toggle"));
toggleAction->setText(i18n("Toggle Show Paint"));
KGlobalAccel::self()->setDefaultShortcut(toggleAction, {});
KGlobalAccel::self()->setShortcut(toggleAction, {});
KGlobalAccel::self()->setDefaultShortcut(toggleAction, QList<QKeySequence>() << (Qt::CTRL | Qt::META | Qt::ALT | Qt::Key_P));
KGlobalAccel::self()->setShortcut(toggleAction, QList<QKeySequence>() << (Qt::CTRL | Qt::META | Qt::ALT | Qt::Key_P));
connect(toggleAction, &QAction::triggered, this, &ShowPaintEffect::toggle);
}

@ -36,8 +36,8 @@ ShowPaintEffectConfig::ShowPaintEffectConfig(QObject *parent, const KPluginMetaD
QAction *toggleAction = actionCollection->addAction(QStringLiteral("Toggle"));
toggleAction->setText(i18n("Toggle Show Paint"));
toggleAction->setProperty("isConfigurationAction", true);
KGlobalAccel::self()->setDefaultShortcut(toggleAction, {});
KGlobalAccel::self()->setShortcut(toggleAction, {});
KGlobalAccel::self()->setDefaultShortcut(toggleAction, QList<QKeySequence>() << (Qt::CTRL | Qt::META | Qt::ALT | Qt::Key_P));
KGlobalAccel::self()->setShortcut(toggleAction, QList<QKeySequence>() << (Qt::CTRL | Qt::META | Qt::ALT | Qt::Key_P));
m_ui.shortcutsEditor->addCollection(actionCollection);

Loading…
Cancel
Save