From 5ce91454c299992392832b2ab25caca6fed98350 Mon Sep 17 00:00:00 2001 From: dengbo Date: Tue, 27 Sep 2022 16:07:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=B1=E8=89=B2=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E4=B8=8B=E4=BB=BB=E5=8A=A1=E6=A0=8F=E8=93=9D?= =?UTF-8?q?=E7=89=99=E5=88=97=E8=A1=A8=E7=9A=84=E8=93=9D=E7=89=99=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根据系统主题的类型去调整蓝牙名称的显示 Log: 修复深色系统主题下任务栏蓝牙列表的蓝牙名称显示异常的问题 Bug: https://pms.uniontech.com/bug-view-138011.html Influence: 任务栏蓝牙名称显示 Change-Id: I697b7304157652085dc0e8fe0ab6e407575128c8 --- .../bluetooth/componments/bluetoothadapteritem.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/bluetooth/componments/bluetoothadapteritem.cpp b/plugins/bluetooth/componments/bluetoothadapteritem.cpp index 837b7ecea..c177c2f55 100644 --- a/plugins/bluetooth/componments/bluetoothadapteritem.cpp +++ b/plugins/bluetooth/componments/bluetoothadapteritem.cpp @@ -185,10 +185,17 @@ void BluetoothAdapterItem::onAdapterNameChanged(const QString name) void BluetoothAdapterItem::updateIconTheme(DGuiApplicationHelper::ColorType type) { - if (type == DGuiApplicationHelper::LightType) + QPalette widgetBackgroud; + if (type == DGuiApplicationHelper::LightType) { m_refreshBtn->setRotateIcon(":/wireless/resources/wireless/refresh_dark.svg"); - else + widgetBackgroud.setColor(QPalette::Background, QColor(255, 255, 255, 0.03 * 255)); + } else { + widgetBackgroud.setColor(QPalette::Background, QColor(0, 0, 0, 0.03 * 255)); m_refreshBtn->setRotateIcon(":/wireless/resources/wireless/refresh.svg"); + } + + m_adapterLabel->label()->setAutoFillBackground(true); + m_adapterLabel->label()->setPalette(widgetBackgroud); } QSize BluetoothAdapterItem::sizeHint() const