From 64fc5a66b13ded82dade1257bd3bcbd03d1853ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1ximo=20Casta=C3=B1eda?= Date: Mon, 30 Nov 2020 15:51:31 +0100 Subject: [PATCH] DefaultMediaTheme: fix Slider scale Values are using a scale of 1000, but limits are set 0..100. Very visible in media preferencies when using balance controls for stereo connections in the mixer: the control is shown full right at first and the moment you touch it and the gain is updated, you only get sound from the left channel. Probably the root cause of #15836 and #16070. Change-Id: I31d3b6b11a57ca99a1cc8373d9fb003f21b192b3 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3445 Reviewed-by: Adrien Destugues --- src/kits/media/DefaultMediaTheme.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/kits/media/DefaultMediaTheme.cpp b/src/kits/media/DefaultMediaTheme.cpp index 392e2c706e..f16d8a0c47 100644 --- a/src/kits/media/DefaultMediaTheme.cpp +++ b/src/kits/media/DefaultMediaTheme.cpp @@ -884,7 +884,8 @@ DefaultMediaTheme::MakeViewFor(BParameter *parameter) } BSlider *slider = new Slider(parameter->Name(), - parameter->Name(), 0, 100, continuous); + parameter->Name(), int32(continuous.MinValue() * 1000), + int32(continuous.MaxValue() * 1000), continuous); return slider; }