mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
feat: 插件区域和托盘区域系统应用右键菜单启用开关
添加gsettings配置作为插件区域应用和托盘区域系统应用右键菜单的启用、禁用开关,修改配置立即生效 Log: 插件区域和托盘区域系统应用右键菜单启用开关,修改配置立即生效 Change-Id: I7f767bc86cdd5d14e02807858bc82cb57a543174
This commit is contained in:
parent
29d8fc4d3e
commit
9dc9273afd
@ -161,8 +161,18 @@ void PluginsItem::mousePressEvent(QMouseEvent *e)
|
|||||||
if (e->button() == Qt::LeftButton)
|
if (e->button() == Qt::LeftButton)
|
||||||
MousePressPoint = e->pos();
|
MousePressPoint = e->pos();
|
||||||
|
|
||||||
// context menu will handle in DockItem
|
//handle context menu
|
||||||
DockItem::mousePressEvent(e);
|
m_popupTipsDelayTimer->stop();
|
||||||
|
hideNonModel();
|
||||||
|
|
||||||
|
if (e->button() == Qt::RightButton) {
|
||||||
|
if (perfectIconRect().contains(e->pos())) {
|
||||||
|
return (m_gsettings && m_gsettings->get("menuEnable").toBool()) ? showContextMenu() : void();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// same as e->ignore above
|
||||||
|
QWidget::mousePressEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginsItem::mouseMoveEvent(QMouseEvent *e)
|
void PluginsItem::mouseMoveEvent(QMouseEvent *e)
|
||||||
|
@ -105,6 +105,13 @@
|
|||||||
Control Module Enable
|
Control Module Enable
|
||||||
</description>
|
</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key type="b" name="menu-enable">
|
||||||
|
<default>true</default>
|
||||||
|
<summary>Menu Enable</summary>
|
||||||
|
<description>
|
||||||
|
Control Menu Enable
|
||||||
|
</description>
|
||||||
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
<schema path="/com/deepin/dde/dock/module/network/" id="com.deepin.dde.dock.module.network" gettext-domain="DDE">
|
<schema path="/com/deepin/dde/dock/module/network/" id="com.deepin.dde.dock.module.network" gettext-domain="DDE">
|
||||||
<key type="b" name="control">
|
<key type="b" name="control">
|
||||||
@ -121,6 +128,13 @@
|
|||||||
Control Module Enable
|
Control Module Enable
|
||||||
</description>
|
</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key type="b" name="menu-enable">
|
||||||
|
<default>true</default>
|
||||||
|
<summary>Menu Enable</summary>
|
||||||
|
<description>
|
||||||
|
Control Menu Enable
|
||||||
|
</description>
|
||||||
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
<schema path="/com/deepin/dde/dock/module/onboard/" id="com.deepin.dde.dock.module.onboard" gettext-domain="DDE">
|
<schema path="/com/deepin/dde/dock/module/onboard/" id="com.deepin.dde.dock.module.onboard" gettext-domain="DDE">
|
||||||
<key type="b" name="control">
|
<key type="b" name="control">
|
||||||
@ -137,6 +151,13 @@
|
|||||||
Control Module Enable
|
Control Module Enable
|
||||||
</description>
|
</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key type="b" name="menu-enable">
|
||||||
|
<default>true</default>
|
||||||
|
<summary>Menu Enable</summary>
|
||||||
|
<description>
|
||||||
|
Control Menu Enable
|
||||||
|
</description>
|
||||||
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
<schema path="/com/deepin/dde/dock/module/bluetooth/" id="com.deepin.dde.dock.module.bluetooth" gettext-domain="DDE">
|
<schema path="/com/deepin/dde/dock/module/bluetooth/" id="com.deepin.dde.dock.module.bluetooth" gettext-domain="DDE">
|
||||||
<key type="b" name="control">
|
<key type="b" name="control">
|
||||||
@ -153,6 +174,13 @@
|
|||||||
Control Module Enable
|
Control Module Enable
|
||||||
</description>
|
</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key type="b" name="menu-enable">
|
||||||
|
<default>true</default>
|
||||||
|
<summary>Menu Enable</summary>
|
||||||
|
<description>
|
||||||
|
Control Menu Enable
|
||||||
|
</description>
|
||||||
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
<schema path="/com/deepin/dde/dock/module/power/" id="com.deepin.dde.dock.module.power" gettext-domain="DDE">
|
<schema path="/com/deepin/dde/dock/module/power/" id="com.deepin.dde.dock.module.power" gettext-domain="DDE">
|
||||||
<key type="b" name="control">
|
<key type="b" name="control">
|
||||||
@ -176,6 +204,13 @@
|
|||||||
Show TimeToFull
|
Show TimeToFull
|
||||||
</description>
|
</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key type="b" name="menu-enable">
|
||||||
|
<default>true</default>
|
||||||
|
<summary>Menu Enable</summary>
|
||||||
|
<description>
|
||||||
|
Control Menu Enable
|
||||||
|
</description>
|
||||||
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
<schema path="/com/deepin/dde/dock/module/shutdown/" id="com.deepin.dde.dock.module.shutdown" gettext-domain="DDE">
|
<schema path="/com/deepin/dde/dock/module/shutdown/" id="com.deepin.dde.dock.module.shutdown" gettext-domain="DDE">
|
||||||
<key type="b" name="control">
|
<key type="b" name="control">
|
||||||
@ -192,6 +227,13 @@
|
|||||||
Control Module Enable
|
Control Module Enable
|
||||||
</description>
|
</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key type="b" name="menu-enable">
|
||||||
|
<default>true</default>
|
||||||
|
<summary>Menu Enable</summary>
|
||||||
|
<description>
|
||||||
|
Control Menu Enable
|
||||||
|
</description>
|
||||||
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
<schema path="/com/deepin/dde/dock/module/sound/" id="com.deepin.dde.dock.module.sound" gettext-domain="DDE">
|
<schema path="/com/deepin/dde/dock/module/sound/" id="com.deepin.dde.dock.module.sound" gettext-domain="DDE">
|
||||||
<key type="b" name="control">
|
<key type="b" name="control">
|
||||||
@ -208,6 +250,13 @@
|
|||||||
Control Module Enable
|
Control Module Enable
|
||||||
</description>
|
</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key type="b" name="menu-enable">
|
||||||
|
<default>true</default>
|
||||||
|
<summary>Menu Enable</summary>
|
||||||
|
<description>
|
||||||
|
Control Menu Enable
|
||||||
|
</description>
|
||||||
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
<schema path="/com/deepin/dde/dock/module/trash/" id="com.deepin.dde.dock.module.trash" gettext-domain="DDE">
|
<schema path="/com/deepin/dde/dock/module/trash/" id="com.deepin.dde.dock.module.trash" gettext-domain="DDE">
|
||||||
<key type="b" name="control">
|
<key type="b" name="control">
|
||||||
@ -224,6 +273,13 @@
|
|||||||
Control Module Enable
|
Control Module Enable
|
||||||
</description>
|
</description>
|
||||||
</key>
|
</key>
|
||||||
|
<key type="b" name="menu-enable">
|
||||||
|
<default>true</default>
|
||||||
|
<summary>Menu Enable</summary>
|
||||||
|
<description>
|
||||||
|
Control Menu Enable
|
||||||
|
</description>
|
||||||
|
</key>
|
||||||
</schema>
|
</schema>
|
||||||
<schema path="/com/deepin/dde/dock/module/systemtray/" id="com.deepin.dde.dock.module.systemtray" gettext-domain="DDE">
|
<schema path="/com/deepin/dde/dock/module/systemtray/" id="com.deepin.dde.dock.module.systemtray" gettext-domain="DDE">
|
||||||
<key type="b" name="control">
|
<key type="b" name="control">
|
||||||
|
@ -239,7 +239,7 @@ void SystemTrayItem::mousePressEvent(QMouseEvent *event)
|
|||||||
|
|
||||||
if (event->button() == Qt::RightButton) {
|
if (event->button() == Qt::RightButton) {
|
||||||
if (perfectIconRect().contains(event->pos(), true)) {
|
if (perfectIconRect().contains(event->pos(), true)) {
|
||||||
return showContextMenu();
|
return (m_gsettings && m_gsettings->get("menuEnable").toBool()) ? showContextMenu() : void();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user