mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
fix(sound): 如果没有声音输出设备则直接静音且菜单不可用
在没有声音输出设备时,后端返回的设备状态为非静音,此状态与实际不符合,应该显示静音状态且菜单不可用,否则根据设备是否静音状态显示菜单 Log: 修复声音插件右键菜单文案和设备实际状态不一致问题 Bug: https://pms.uniontech.com/zentao/bug-view-95855.html Influence: 声音插件右键菜单文案和设备实际状态保持一致 Change-Id: I87f91d0856e94e989bd2056ed1cc6dacca17271f
This commit is contained in:
parent
7f861dfe97
commit
b0115762a6
@ -88,12 +88,14 @@ const QString SoundItem::contextMenu()
|
||||
|
||||
QMap<QString, QVariant> open;
|
||||
open["itemId"] = MUTE;
|
||||
if (m_sinkInter->mute()) {
|
||||
|
||||
// 如果没有可用输出设备,直接显示静音菜单不可用
|
||||
if (!m_applet->existActiveOutputDevice()) {
|
||||
open["itemText"] = tr("Unmute");
|
||||
if (!m_applet->existActiveOutputDevice())
|
||||
open["isActive"] = false;
|
||||
else
|
||||
open["isActive"] = true;
|
||||
open["isActive"] = false;
|
||||
} else if (m_sinkInter->mute()) {
|
||||
open["itemText"] = tr("Unmute");
|
||||
open["isActive"] = true;
|
||||
} else {
|
||||
open["itemText"] = tr("Mute");
|
||||
open["isActive"] = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user