Drop delegating Workspace::slotInvertScreen
Instead directly connect global shortcut to the method in Platform.icc-effect-5.14.5
parent
e6ca321317
commit
9b1827803f
|
@ -42,6 +42,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#define DEF5( name, key, functor, value ) \
|
#define DEF5( name, key, functor, value ) \
|
||||||
initShortcut(QStringLiteral(name).arg(value), i18n(name, value), key, functor, value);
|
initShortcut(QStringLiteral(name).arg(value), i18n(name, value), key, functor, value);
|
||||||
|
|
||||||
|
#define DEF6( name, key, target, fnSlot ) \
|
||||||
|
initShortcut(QStringLiteral(name), i18n(name), key, target, &fnSlot);
|
||||||
|
|
||||||
|
|
||||||
DEF(I18N_NOOP("Walk Through Window Tabs"), 0, slotActivateNextTab);
|
DEF(I18N_NOOP("Walk Through Window Tabs"), 0, slotActivateNextTab);
|
||||||
DEF(I18N_NOOP("Walk Through Window Tabs (Reverse)"), 0, slotActivatePrevTab);
|
DEF(I18N_NOOP("Walk Through Window Tabs (Reverse)"), 0, slotActivatePrevTab);
|
||||||
|
@ -157,7 +160,7 @@ DEF(I18N_NOOP("Switch to Previous Screen"), 0, slotSwitchToPrevScreen);
|
||||||
|
|
||||||
DEF(I18N_NOOP("Kill Window"), Qt::CTRL + Qt::ALT + Qt::Key_Escape, slotKillWindow);
|
DEF(I18N_NOOP("Kill Window"), Qt::CTRL + Qt::ALT + Qt::Key_Escape, slotKillWindow);
|
||||||
DEF(I18N_NOOP("Suspend Compositing"), Qt::SHIFT + Qt::ALT + Qt::Key_F12, slotToggleCompositing);
|
DEF(I18N_NOOP("Suspend Compositing"), Qt::SHIFT + Qt::ALT + Qt::Key_F12, slotToggleCompositing);
|
||||||
DEF(I18N_NOOP("Invert Screen Colors"), 0, slotInvertScreen);
|
DEF6(I18N_NOOP("Invert Screen Colors"), 0, kwinApp()->platform(), Platform::invertScreen);
|
||||||
|
|
||||||
#undef DEF
|
#undef DEF
|
||||||
#undef DEF2
|
#undef DEF2
|
||||||
|
|
|
@ -979,6 +979,12 @@ void Workspace::closeActivePopup()
|
||||||
|
|
||||||
template <typename Slot>
|
template <typename Slot>
|
||||||
void Workspace::initShortcut(const QString &actionName, const QString &description, const QKeySequence &shortcut, Slot slot, const QVariant &data)
|
void Workspace::initShortcut(const QString &actionName, const QString &description, const QKeySequence &shortcut, Slot slot, const QVariant &data)
|
||||||
|
{
|
||||||
|
initShortcut(actionName, description, shortcut, this, slot, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename T, typename Slot>
|
||||||
|
void Workspace::initShortcut(const QString &actionName, const QString &description, const QKeySequence &shortcut, T *receiver, Slot slot, const QVariant &data)
|
||||||
{
|
{
|
||||||
QAction *a = new QAction(this);
|
QAction *a = new QAction(this);
|
||||||
a->setProperty("componentName", QStringLiteral(KWIN_NAME));
|
a->setProperty("componentName", QStringLiteral(KWIN_NAME));
|
||||||
|
@ -989,7 +995,7 @@ void Workspace::initShortcut(const QString &actionName, const QString &descripti
|
||||||
}
|
}
|
||||||
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << shortcut);
|
KGlobalAccel::self()->setDefaultShortcut(a, QList<QKeySequence>() << shortcut);
|
||||||
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << shortcut);
|
KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << shortcut);
|
||||||
input()->registerShortcut(shortcut, a, this, slot);
|
input()->registerShortcut(shortcut, a, receiver, slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -1703,11 +1709,6 @@ void Workspace::slotWindowResize()
|
||||||
performWindowOperation(active_client, Options::UnrestrictedResizeOp);
|
performWindowOperation(active_client, Options::UnrestrictedResizeOp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Workspace::slotInvertScreen()
|
|
||||||
{
|
|
||||||
kwinApp()->platform()->invertScreen();
|
|
||||||
}
|
|
||||||
|
|
||||||
#undef USABLE_ACTIVE_CLIENT
|
#undef USABLE_ACTIVE_CLIENT
|
||||||
|
|
||||||
void AbstractClient::setShortcut(const QString& _cut)
|
void AbstractClient::setShortcut(const QString& _cut)
|
||||||
|
|
|
@ -444,7 +444,6 @@ public Q_SLOTS:
|
||||||
void slotSetupWindowShortcut();
|
void slotSetupWindowShortcut();
|
||||||
void setupWindowShortcutDone(bool);
|
void setupWindowShortcutDone(bool);
|
||||||
void slotToggleCompositing();
|
void slotToggleCompositing();
|
||||||
void slotInvertScreen();
|
|
||||||
|
|
||||||
void updateClientArea();
|
void updateClientArea();
|
||||||
|
|
||||||
|
@ -502,6 +501,8 @@ private:
|
||||||
template <typename Slot>
|
template <typename Slot>
|
||||||
void initShortcut(const QString &actionName, const QString &description, const QKeySequence &shortcut,
|
void initShortcut(const QString &actionName, const QString &description, const QKeySequence &shortcut,
|
||||||
Slot slot, const QVariant &data = QVariant());
|
Slot slot, const QVariant &data = QVariant());
|
||||||
|
template <typename T, typename Slot>
|
||||||
|
void initShortcut(const QString &actionName, const QString &description, const QKeySequence &shortcut, T *receiver, Slot slot, const QVariant &data = QVariant());
|
||||||
void setupWindowShortcut(AbstractClient* c);
|
void setupWindowShortcut(AbstractClient* c);
|
||||||
bool switchWindow(AbstractClient *c, Direction direction, QPoint curPos, int desktop);
|
bool switchWindow(AbstractClient *c, Direction direction, QPoint curPos, int desktop);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue