mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix: 声音插件设备名颜色异常
当主题改变时,收到信号后同步修改设备名颜色 Log: 修复声音插件设备名颜色异常问题 Bug: https://pms.uniontech.com/zentao/bug-view-44531.html Change-Id: I4e5e51c97c69bbe3d464f8116b498ae821e8826a Reviewed-on: http://gerrit.uniontech.com/c/dde-dock/+/2746 Reviewed-by: <mailman@uniontech.com> Reviewed-by: fanpengcheng <fanpengcheng@uniontech.com> Reviewed-by: niecheng <niecheng@uniontech.com> Tested-by: <mailman@uniontech.com>
This commit is contained in:
parent
72ebd36a51
commit
a93d8a0368
@ -395,11 +395,22 @@ void SoundApplet::refreshIcon()
|
||||
QString iconLeft = QString("audio-volume-%1-symbolic").arg(volumeString);
|
||||
QString iconRight = QString("audio-volume-high-symbolic");
|
||||
|
||||
if (DGuiApplicationHelper::instance()->themeType() == DGuiApplicationHelper::LightType) {
|
||||
QColor color;
|
||||
switch (DGuiApplicationHelper::instance()->themeType()) {
|
||||
case DGuiApplicationHelper::LightType:
|
||||
color = Qt::black;
|
||||
iconLeft.append("-dark");
|
||||
iconRight.append("-dark");
|
||||
break;
|
||||
default:
|
||||
color = Qt::white;
|
||||
break;
|
||||
}
|
||||
//主题改变时,同步修改item颜色
|
||||
for (int i = 0; i < m_model->rowCount(); i++) {
|
||||
auto item = m_model->item(i);
|
||||
item->setForeground(color);
|
||||
}
|
||||
|
||||
const auto ratio = devicePixelRatioF();
|
||||
QPixmap ret = ImageUtil::loadSvg(iconRight, ":/", ICON_SIZE, ratio);
|
||||
m_volumeIconMax->setPixmap(ret);
|
||||
|
Loading…
x
Reference in New Issue
Block a user