Skip to content

Commit dcbb784

Browse files
Warchamp7RytoEX
authored andcommitted
frontend: Show warning icon for Monitor Only
1 parent 04d36e0 commit dcbb784

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

frontend/components/VolumeControl.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ VolumeControl::~VolumeControl()
164164
}
165165
}
166166

167-
const QIcon &VolumeControl::getUnassignedIcon()
167+
const QIcon &VolumeControl::getWarningIcon()
168168
{
169169
static const QIcon &icon = *new QIcon(":/res/images/unassigned.svg");
170170
return icon;
@@ -773,6 +773,7 @@ void VolumeControl::processMixerState()
773773
bool showAsMuted = obsMuted || obsMonitoringType == OBS_MONITORING_TYPE_MONITOR_ONLY;
774774
bool showAsMonitored = obsMonitoringType != OBS_MONITORING_TYPE_NONE;
775775
bool showAsUnassigned = !obsMuted && unassigned;
776+
bool showWarningIcon = showAsUnassigned || obsMonitoringType == OBS_MONITORING_TYPE_MONITOR_ONLY;
776777

777778
volumeMeter->setMuted((showAsMuted || showAsUnassigned) && !showAsMonitored);
778779
setUseDisabledColors(showAsMuted || !isActive);
@@ -787,8 +788,8 @@ void VolumeControl::processMixerState()
787788
: QTStr("Basic.AudioMixer.Monitoring.Enable");
788789
monitorButton->setToolTip(monitorTooltip);
789790

790-
if (showAsUnassigned) {
791-
muteButton->setIcon(getUnassignedIcon());
791+
if (showWarningIcon) {
792+
muteButton->setIcon(getWarningIcon());
792793
} else if (showAsMuted) {
793794
muteButton->setIcon(getMutedIcon());
794795
} else {
@@ -806,7 +807,7 @@ void VolumeControl::processMixerState()
806807
utils->toggleClass(muteButton, "checked", showAsMuted);
807808
utils->toggleClass(monitorButton, "checked", showAsMonitored);
808809

809-
utils->toggleClass(muteButton, "mute-unassigned", showAsUnassigned);
810+
utils->toggleClass(muteButton, "mute-warning", showWarningIcon);
810811

811812
style()->polish(muteButton);
812813
style()->polish(monitorButton);

frontend/components/VolumeControl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class VolumeControl : public QFrame {
9292

9393
QMenu *contextMenu;
9494

95-
static const QIcon &getUnassignedIcon();
95+
static const QIcon &getWarningIcon();
9696
static const QIcon &getMutedIcon();
9797
static const QIcon &getUnmutedIcon();
9898
static const QIcon &getMonitorOnIcon();

frontend/data/themes/Yami.obt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,14 +1674,14 @@ QSlider::handle:disabled {
16741674
border-color: var(--red1);
16751675
}
16761676

1677-
.btn-mute.mute-unassigned {
1677+
.btn-mute.mute-warning {
16781678
color: var(--yellow1);
16791679
background: var(--yellow6);
16801680
qproperty-icon: url(theme:Dark/unassigned.svg);
16811681
}
16821682

1683-
.btn-mute.mute-unassigned.hover,
1684-
.btn-mute.mute-unassigned:focus {
1683+
.btn-mute.mute-warning.hover,
1684+
.btn-mute.mute-warning:focus {
16851685
border-color: var(--yellow1);
16861686
}
16871687

0 commit comments

Comments
 (0)