From 64a1fc174ff668f3fd142104034bb47cd07689f0 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 23 Oct 2022 15:42:16 +0100 Subject: [PATCH] Change: Scale thickness of slider bevel. --- src/widgets/slider.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/widgets/slider.cpp b/src/widgets/slider.cpp index 5bad981936..5ed9ef3cbb 100644 --- a/src/widgets/slider.cpp +++ b/src/widgets/slider.cpp @@ -31,6 +31,7 @@ void DrawSliderWidget(Rect r, int min_value, int max_value, int value) /* Draw a wedge indicating low to high value. */ const int ha = (r.bottom - r.top) / 5; + const int t = WidgetDimensions::scaled.bevel.top; /* Thickness of lines */ int wx1 = r.left, wx2 = r.right; if (_current_text_dir == TD_RTL) std::swap(wx1, wx2); const uint shadow = _colour_gradient[COLOUR_GREY][3]; @@ -38,9 +39,9 @@ void DrawSliderWidget(Rect r, int min_value, int max_value, int value) const uint light = _colour_gradient[COLOUR_GREY][7]; const std::vector wedge{ Point{wx1, r.bottom - ha}, Point{wx2, r.top + ha}, Point{wx2, r.bottom - ha} }; GfxFillPolygon(wedge, fill); - GfxDrawLine(wedge[0].x, wedge[0].y, wedge[2].x, wedge[2].y, light); - GfxDrawLine(wedge[1].x, wedge[1].y, wedge[2].x, wedge[2].y, _current_text_dir == TD_RTL ? shadow : light); - GfxDrawLine(wedge[0].x, wedge[0].y, wedge[1].x, wedge[1].y, shadow); + GfxDrawLine(wedge[0].x, wedge[0].y, wedge[2].x, wedge[2].y, light, t); + GfxDrawLine(wedge[1].x, wedge[1].y, wedge[2].x, wedge[2].y, _current_text_dir == TD_RTL ? shadow : light, t); + GfxDrawLine(wedge[0].x, wedge[0].y, wedge[1].x, wedge[1].y, shadow, t); /* Draw a slider handle indicating current value. */ const int sw = ScaleGUITrad(SLIDER_WIDTH);