D22287: [colorcorrection] Introduce toggle Night Color shortcut

Kai Uwe Broulik noreply at phabricator.kde.org
Fri Jul 5 12:04:24 BST 2019


broulik added inline comments.

INLINE COMMENTS

> manager.cpp:172
> +{
> +    QAction *toggleAction = new QAction(this);
> +    toggleAction->setProperty("componentName", QStringLiteral(KWIN_NAME));

Everywhere else in KWin (and other apps) we use a `KActionCollection` for this:

  m_actionCollection = new KActionCollection(this, QStringLiteral("kwin"));
  m_actionCollection->setComponentDisplayName(i18n("KWin"));

with `m_actionCollection->addAction` (which sets the `objectName`)

> manager.cpp:176
> +    toggleAction->setText(i18n("Toggle Night Color"));
> +    KGlobalAccel::setGlobalShortcut(toggleAction, QKeySequence());
> +    input()->registerShortcut(QKeySequence(), toggleAction, this, &Manager::toggle);

Given we don't actually set a shortcut, isn't

  KGlobalAccel::self()->setShortcut(action, QList<QKeySequence>{});

the proper way?

REPOSITORY
  R108 KWin

REVISION DETAIL
  https://phabricator.kde.org/D22287

To: zzag, #kwin
Cc: broulik, davidedmundson, kwin, LeGast00n, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, Pitel, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20190705/1b97b189/attachment.html>


More information about the kwin mailing list