qt: Fix mute icon in CD-ROM menus

This commit is contained in:
Cacodemon345
2023-03-31 21:24:12 +06:00
committed by GitHub
parent 542f8477e7
commit 76dee5d47e

View File

@@ -572,7 +572,8 @@ MediaMenu::cdromUpdateMenu(int i)
auto childs = menu->children();
auto *muteMenu = dynamic_cast<QAction *>(childs[cdromMutePos]);
muteMenu->setChecked(cdrom[i].sound_on == 0);
muteMenu->setIcon(QApplication::style()->standardIcon((cdrom[i].sound_on == 0) ? QStyle::SP_MediaVolume : QStyle::SP_MediaVolumeMuted));
muteMenu->setText((cdrom[i].sound_on == 0) ? tr("&Unmute") : tr("&Mute"));
auto *imageMenu = dynamic_cast<QAction *>(childs[cdromImagePos]);
imageMenu->setEnabled(!name.isEmpty());