From 703da727b1aa3c2e63ac08844790c2ce368684f5 Mon Sep 17 00:00:00 2001 From: Fan PengCheng Date: Fri, 7 May 2021 19:47:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E7=BA=A7=E5=88=AB=E9=85=8D=E7=BD=AE=E9=83=A8=E5=88=86=E4=B8=8D?= =?UTF-8?q?=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当此配置要求应用隐藏(com.deepin.dde.dock.module.app enable=false)时,及时activeapp的配置的enable为true,应用仍然隐藏 托盘应用区域com.deepin.dde.dock.module.systemtray control不生效的问题也一起修复 Log: Task: https://pms.uniontech.com/zentao/task-view-64795.html Change-Id: I49d6a26425509948038ef80d8b31d23483460299 --- frame/item/appitem.cpp | 4 ++-- plugins/tray/system-trays/systemtrayitem.cpp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index 8f207fe64..354dadf7d 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -732,8 +732,8 @@ bool AppItem::checkGSettingsControl() const ? m_dockedAppSettings : m_activeAppSettings; - return (setting && setting->keys().contains("control") && setting->get("control").toBool()) || - (m_appSettings && m_appSettings->keys().contains("control") && m_appSettings->get("control").toBool()); + return ((m_appSettings && m_appSettings->keys().contains("control") && m_appSettings->get("control").toBool()) + || (setting && setting->keys().contains("control") && setting->get("control").toBool())); } void AppItem::onThemeTypeChanged(DGuiApplicationHelper::ColorType themeType) diff --git a/plugins/tray/system-trays/systemtrayitem.cpp b/plugins/tray/system-trays/systemtrayitem.cpp index 312f5df83..1b422bd28 100644 --- a/plugins/tray/system-trays/systemtrayitem.cpp +++ b/plugins/tray/system-trays/systemtrayitem.cpp @@ -491,5 +491,7 @@ void SystemTrayItem::onGSettingsChanged(const QString &key) { bool SystemTrayItem::checkGSettingsControl() const { - return (m_gsettings && m_gsettings->get("control").toBool()); + // 优先判断com.deepin.dde.dock.module.systemtray的control值是否为true(优先级更高),如果不为true,再判断每一个托盘对应的gsetting配置的control值 + bool isEnable = Utils::SettingValue("com.deepin.dde.dock.module.systemtray", QByteArray(), "control", false).toBool(); + return (isEnable || (m_gsettings && m_gsettings->get("control").toBool())); }