effects: add Meta+plus as a default shortcut for Zoom effect

Right now the Zoom effect's "zoom in" action is bound by Meta+Equals,
which makes sense for ANSI US keyboards without numberpads which make
you hit the Shift key before you can get a plus sign, and pressing it
without Shift gets you an Equals sign.

But some ANSI US keyboards have a numberpad with a Plus key, and many
other keyboards without numberpads also have a Plus key, so we should
allow users of those keyboards to trigger "zoom in" as easily as users
of ANSI US keyboards.
This commit is contained in:
Nate Graham 2022-08-26 12:53:33 +02:00
parent 345736735e
commit 3cf7737042
2 changed files with 4 additions and 4 deletions

View file

@ -47,8 +47,8 @@ ZoomEffect::ZoomEffect()
initConfig<ZoomConfig>();
QAction *a = nullptr;
a = KStandardAction::zoomIn(this, SLOT(zoomIn()), this);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Equal));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Equal));
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Plus));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Plus) << (Qt::META | Qt::Key_Equal));
effects->registerGlobalShortcut(Qt::META | Qt::Key_Equal, a);
effects->registerAxisShortcut(Qt::ControlModifier | Qt::MetaModifier, PointerAxisDown, a);

View file

@ -62,8 +62,8 @@ ZoomEffectConfig::ZoomEffectConfig(QWidget *parent, const QVariantList &args)
QAction *a;
a = actionCollection->addAction(KStandardAction::ZoomIn);
a->setProperty("isConfigurationAction", true);
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Equal));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Equal));
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Plus));
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << (Qt::META | Qt::Key_Plus) << (Qt::META | Qt::Key_Equal));
a = actionCollection->addAction(KStandardAction::ZoomOut);
a->setProperty("isConfigurationAction", true);