fix: 修复任务栏关机按钮右键菜单无法响应的问题

完善菜单项的点击接口,保证其能正确触发对应的菜单功能

Log:
Influence: 任务栏-时尚模式下右键菜单功能
Task: https://pms.uniontech.com/task-view-110311.html
Change-Id: Id8d7d767534543d15eda79f77012e21ccdb2527d
This commit is contained in:
donghualin 2022-06-14 10:46:42 +00:00
parent 322623427d
commit 44b92d90f5
3 changed files with 7 additions and 1 deletions

View File

@ -239,6 +239,11 @@ const QString StretchPluginsItem::contextMenu() const
return m_pluginInter->itemContextMenu(m_itemKey); 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) void StretchPluginsItem::mousePressEvent(QMouseEvent *e)
{ {
m_hover = false; m_hover = false;

View File

@ -80,6 +80,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *e) override; void mouseReleaseEvent(QMouseEvent *e) override;
const QString contextMenu() const override; const QString contextMenu() const override;
void invokedMenuItem(const QString &itemId, const bool checked) override;
private: private:
void mouseClick(); void mouseClick();

View File

@ -237,7 +237,7 @@ void ShutdownPlugin::invokedMenuItem(const QString &itemKey, const QString &menu
.service("com.deepin.dde.ControlCenter") .service("com.deepin.dde.ControlCenter")
.interface("com.deepin.dde.ControlCenter") .interface("com.deepin.dde.ControlCenter")
.path("/com/deepin/dde/ControlCenter") .path("/com/deepin/dde/ControlCenter")
.method(QString("ShowModule")) .method(QString("ShowPage"))
.arg(QString("power")) .arg(QString("power"))
.call(); .call();
} else if (menuId == "Lock") { } else if (menuId == "Lock") {