mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix: 无声卡输出设备时,tips 显示静音,音量为0
需求: 无声卡时,图标显示静音,音量条显示在0%且置灰,tips显示“静音” Log: 无声卡时,图标显示静音,音量条显示在0%且置灰,tips显示“静音” Bug: https://pms.uniontech.com/zentao/bug-view-106166.html Influence: dock栏声音显示 Change-Id: Iec1712b82a5492ae750e96b0683f1e9eef8c74a2
This commit is contained in:
parent
507a8fcc99
commit
6586c84b90
@ -296,7 +296,8 @@ void SoundApplet::onDefaultSinkChanged()
|
||||
}
|
||||
activePort(portId,cardId);
|
||||
|
||||
onVolumeChanged(m_defSinkInter->volume());
|
||||
//无声卡状态下,会有伪sink设备,显示音量为0
|
||||
onVolumeChanged(findPort(portId, cardId) != nullptr ? m_defSinkInter->volume() : 0);
|
||||
emit defaultSinkChanged(m_defSinkInter);
|
||||
}
|
||||
|
||||
|
@ -231,8 +231,8 @@ void SoundItem::refreshTips(const int volume, const bool force)
|
||||
if (!force && !m_tipsLabel->isVisible())
|
||||
return;
|
||||
|
||||
QString value;
|
||||
if (m_sinkInter->mute()) {
|
||||
const bool mute = m_applet->existActiveOutputDevice() ? m_sinkInter->mute() : true;
|
||||
if (mute) {
|
||||
m_tipsLabel->setText(QString(tr("Mute")));
|
||||
} else {
|
||||
m_tipsLabel->setText(QString(tr("Volume %1").arg(QString::number(volume) + '%')));
|
||||
|
Loading…
x
Reference in New Issue
Block a user