From 90ff8ecd0f7dea05126f14b3756c69e1aafb5ab1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 23 Jun 2021 20:14:22 +0400 Subject: [PATCH] Fix volume slider in voice chats. --- Telegram/SourceFiles/ui/widgets/continuous_sliders.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/ui/widgets/continuous_sliders.cpp b/Telegram/SourceFiles/ui/widgets/continuous_sliders.cpp index 5161405ef1..ba11fc0f82 100644 --- a/Telegram/SourceFiles/ui/widgets/continuous_sliders.cpp +++ b/Telegram/SourceFiles/ui/widgets/continuous_sliders.cpp @@ -260,7 +260,14 @@ void MediaSlider::paintEvent(QPaintEvent *e) { : seekRect.height(); const auto from = 0; const auto length = (horizontal ? width() : height()); - const auto mid = qRound(from + value * length); + const auto alwaysSeekSize = horizontal + ? _st.seekSize.width() + : _st.seekSize.height(); + const auto mid = _alwaysDisplayMarker + ? qRound(from + + (alwaysSeekSize / 2.) + + value * (length - alwaysSeekSize)) + : qRound(from + value * length); const auto till = std::max(mid, qRound(from + receivedTill * length)); const auto end = from + length; const auto activeFg = disabled