UI: Display infinity symbol when volume is at 0 percent

This commit is contained in:
Clayton Groeneveld committed 2019-07-19 23:15:14 -05:00
1 parent 15770712a8
commit 6da1df2ece
2 files changed
+11 -5

No files matched your search

+9 -3
View File
@@ -74,9 +74,15 @@ void VolControl::SliderChanged(int vol)
void VolControl::updateText()
{
QString db = QString::number(obs_fader_get_db(obs_fader), 'f', 1)
.append(" dB");
volLabel->setText(db);
QString text;
float db = obs_fader_get_db(obs_fader);
if (db < -96.0f)
text = "-" + QT_UTF8("\u221E") + " dB";
else
text = QString::number(db, 'f', 1).append(" dB");
volLabel->setText(text);
bool muted = obs_source_muted(source);
const char *accTextLookup = muted ? "VolControl.SliderMuted"