1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:57:45 +00:00

AudioApplet: Make sure to set the internal volume on slider change

This fixes the issue that the percent label doesn't update.
This commit is contained in:
David Isaksson 2021-09-18 13:46:13 +02:00 committed by Andreas Kling
parent 3f6ccf63fe
commit bd48abab8b

View file

@ -95,7 +95,8 @@ public:
m_slider->set_value(m_slider->max() - m_audio_volume);
m_slider->set_knob_size_mode(GUI::Slider::KnobSizeMode::Proportional);
m_slider->on_change = [&](int value) {
double volume = clamp(static_cast<double>(m_slider->max() - value) / m_slider->max(), 0.0, 1.0);
m_audio_volume = m_slider->max() - value;
double volume = clamp(static_cast<double>(m_audio_volume) / m_slider->max(), 0.0, 1.0);
m_audio_client->set_main_mix_volume(volume);
update();
};