From 44b92d90f5184127b243a0aaca32ec988dd43fad Mon Sep 17 00:00:00 2001 From: donghualin Date: Tue, 14 Jun 2022 10:46:42 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=A0=8F=E5=85=B3=E6=9C=BA=E6=8C=89=E9=92=AE=E5=8F=B3=E9=94=AE?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=97=A0=E6=B3=95=E5=93=8D=E5=BA=94=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 完善菜单项的点击接口,保证其能正确触发对应的菜单功能 Log: Influence: 任务栏-时尚模式下右键菜单功能 Task: https://pms.uniontech.com/task-view-110311.html Change-Id: Id8d7d767534543d15eda79f77012e21ccdb2527d --- frame/window/systempluginwindow.cpp | 5 +++++ frame/window/systempluginwindow.h | 1 + plugins/shutdown/shutdownplugin.cpp | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frame/window/systempluginwindow.cpp b/frame/window/systempluginwindow.cpp index e32ffaac6..fe50095e7 100644 --- a/frame/window/systempluginwindow.cpp +++ b/frame/window/systempluginwindow.cpp @@ -239,6 +239,11 @@ const QString StretchPluginsItem::contextMenu() const return m_pluginInter->itemContextMenu(m_itemKey); } +void StretchPluginsItem::invokedMenuItem(const QString &itemId, const bool checked) +{ + m_pluginInter->invokedMenuItem(m_itemKey, itemId, checked); +} + void StretchPluginsItem::mousePressEvent(QMouseEvent *e) { m_hover = false; diff --git a/frame/window/systempluginwindow.h b/frame/window/systempluginwindow.h index 2c7314337..15d814d36 100644 --- a/frame/window/systempluginwindow.h +++ b/frame/window/systempluginwindow.h @@ -80,6 +80,7 @@ protected: void mouseReleaseEvent(QMouseEvent *e) override; const QString contextMenu() const override; + void invokedMenuItem(const QString &itemId, const bool checked) override; private: void mouseClick(); diff --git a/plugins/shutdown/shutdownplugin.cpp b/plugins/shutdown/shutdownplugin.cpp index 9a6b75d9c..4a29c9fb5 100644 --- a/plugins/shutdown/shutdownplugin.cpp +++ b/plugins/shutdown/shutdownplugin.cpp @@ -237,7 +237,7 @@ void ShutdownPlugin::invokedMenuItem(const QString &itemKey, const QString &menu .service("com.deepin.dde.ControlCenter") .interface("com.deepin.dde.ControlCenter") .path("/com/deepin/dde/ControlCenter") - .method(QString("ShowModule")) + .method(QString("ShowPage")) .arg(QString("power")) .call(); } else if (menuId == "Lock") {