From 68b74488476c7c70c356d87c8e90e29f5578b7ed Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Sun, 16 Jun 2024 10:46:49 -0600 Subject: [PATCH] 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. --- src/plugins/showpaint/showpaint.cpp | 4 ++-- src/plugins/showpaint/showpaint_config.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/showpaint/showpaint.cpp b/src/plugins/showpaint/showpaint.cpp index 6772d47add..d721eb67a2 100644 --- a/src/plugins/showpaint/showpaint.cpp +++ b/src/plugins/showpaint/showpaint.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() << (Qt::CTRL | Qt::META | Qt::ALT | Qt::Key_P)); + KGlobalAccel::self()->setShortcut(toggleAction, QList() << (Qt::CTRL | Qt::META | Qt::ALT | Qt::Key_P)); connect(toggleAction, &QAction::triggered, this, &ShowPaintEffect::toggle); } diff --git a/src/plugins/showpaint/showpaint_config.cpp b/src/plugins/showpaint/showpaint_config.cpp index 4b1cd8afd5..e22b4e51cd 100644 --- a/src/plugins/showpaint/showpaint_config.cpp +++ b/src/plugins/showpaint/showpaint_config.cpp @@ -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() << (Qt::CTRL | Qt::META | Qt::ALT | Qt::Key_P)); + KGlobalAccel::self()->setShortcut(toggleAction, QList() << (Qt::CTRL | Qt::META | Qt::ALT | Qt::Key_P)); m_ui.shortcutsEditor->addCollection(actionCollection);