From 2089ab1f854abe6363ab1ebd2bb08bea813f58f3 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Wed, 19 Nov 2025 00:55:09 +0100 Subject: [PATCH] check enableUiEnhancements flag --- client/widgets/Slider.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/client/widgets/Slider.cpp b/client/widgets/Slider.cpp index 378161a24..9ea025dfd 100644 --- a/client/widgets/Slider.cpp +++ b/client/widgets/Slider.cpp @@ -21,6 +21,8 @@ #include "../render/Colors.h" #include "../render/IRenderHandler.h" +#include "../../lib/CConfigHandler.h" + void CSlider::mouseDragged(const Point & cursorPosition, const Point & lastUpdateDistance) { bool onControl = pos.isInside(cursorPosition) && !left->pos.isInside(cursorPosition) && !right->pos.isInside(cursorPosition); @@ -293,13 +295,18 @@ void CSlider::setAmount( int to ) positions = to - capacity; vstd::amax(positions, 0); - int track = length - 32; - if(to > 0) - barLength = (track * capacity) / to; + if(settings["general"]["enableUiEnhancements"].Bool()) + { + int track = length - 32; + if(to > 0) + barLength = (track * capacity) / to; + else + barLength = track; + vstd::amax(barLength, 16); + vstd::amin(barLength, track); + } else - barLength = track; - vstd::amax(barLength, 16); - vstd::amin(barLength, track); + barLength = 16; updateSlider(); updateSliderPos();