Commit 92a7089e authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[AppMenu Applet] Wire up DBusMenuImporter::actionActivationRequested

Ensures that pressing e.g. Alt+F will popup the "File" menu.

BUG: 376726
FIXED-IN: 5.10.3

Differential Revision: https://phabricator.kde.org/D6336
parent efac82ad
......@@ -115,6 +115,7 @@ Item {
AppMenuPrivate.AppMenuModel {
id: appMenuModel
onRequestActivateIndex: plasmoid.nativeInterface.requestActivateIndex(index)
Component.onCompleted: {
plasmoid.nativeInterface.model = appMenuModel
}
......
......@@ -259,5 +259,13 @@ void AppMenuModel::updateApplicationMenu(const QString &serviceName, const QStri
setMenuAvailable(true);
emit modelNeedsUpdate();
});
connect(m_importer.data(), &DBusMenuImporter::actionActivationRequested, this, [this](QAction *action) {
// TODO submenus
auto it = std::find(m_activeActions.constBegin(), m_activeActions.constEnd(), action);
if (it != m_activeActions.constEnd()) {
requestActivateIndex(it - m_activeActions.constBegin());
}
});
}
......@@ -53,6 +53,9 @@ public:
bool menuAvailable() const;
void setMenuAvailable(bool set);
signals:
void requestActivateIndex(int index);
private Q_SLOTS:
void onActiveWindowChanged(WId id);
void update();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment