Show the same microphone icon in red when stream audio is off

This commit is contained in:
evgeny committed 2026-11-01 22:09:39 +01:00
1 parent 44b7efb1ce
commit a2d700d5a6
2 files changed
+6 -3

No files matched your search

+1 -2
View File
@@ -130,11 +130,10 @@ inline QIcon controlIcon(const QPalette& palette, const QString& shape, const QS
painter.translate(20, 18);
for (int i = 0; i < 8; i++) { painter.drawLine(0, -10, 0, -15); painter.rotate(45); }
painter.drawEllipse(QPointF(), 10, 10); painter.drawEllipse(QPointF(), 4, 4);
} else if (shape == "microphone" || shape == "microphone-muted") {
} else if (shape == "microphone") {
painter.save(); painter.translate(7, 0); painter.scale(0.65, 0.65);
painter.drawRoundedRect(QRectF(15, 3, 10, 19), 5, 5); painter.drawArc(QRectF(10, 12, 20, 16), 180 * 16, 180 * 16);
painter.drawLine(20, 28, 20, 33); painter.drawLine(14, 33, 26, 33);
if (shape == "microphone-muted") painter.drawLine(9, 3, 32, 28);
painter.restore(); labelRect = QRectF(1, 23, 38, 13); labelSize = 9;
} else if (shape == "sound" || shape == "silent" || shape == "output") {
if (shape == "output") { painter.save(); painter.translate(7, 0); painter.scale(0.65, 0.65); }
+5 -1
View File
@@ -505,7 +505,11 @@ void StreamPublishWindow::updateMenuButtons() {
update(m_rotation, "Rotation", "rotation", QStringLiteral("%1°").arg(config.video.rotation), {}, config.video.rotation);
update(m_maxQp, "Maximum QP", "qp", value(m_maxQp).toInt() ? value(m_maxQp).toString() : "Auto", "QP");
update(m_microphone, "Audio source", config.audio ? "microphone" : "silent", config.audio ? selected(m_microphone)->text() : QString());
m_sound->setIcon(controlIcon(palette(), m_sound->isChecked() ? "microphone" : "microphone-muted", QStringLiteral("Mute")));
auto microphonePalette = palette();
if (!m_sound->isChecked()) microphonePalette.setColor(QPalette::WindowText, QColor(220, 60, 60));
auto microphoneIcon = controlIcon(microphonePalette, "microphone", QStringLiteral("Mute"));
microphoneIcon.addPixmap(microphoneIcon.pixmap(m_sound->iconSize()), QIcon::Disabled); // «Без звука» тоже остаётся красным.
m_sound->setIcon(microphoneIcon);
m_sound->setToolTip(QStringLiteral("Mute"));
m_sound->setAccessibleName(m_sound->toolTip());
m_menuBar->setFixedWidth(m_menuBar->sizeHint().width());