mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-16 00:12:51 +00:00
Change: Scale thickness of slider bevel.
This commit is contained in:
parent
1180c95372
commit
64a1fc174f
@ -31,6 +31,7 @@ void DrawSliderWidget(Rect r, int min_value, int max_value, int value)
|
|||||||
|
|
||||||
/* Draw a wedge indicating low to high value. */
|
/* Draw a wedge indicating low to high value. */
|
||||||
const int ha = (r.bottom - r.top) / 5;
|
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;
|
int wx1 = r.left, wx2 = r.right;
|
||||||
if (_current_text_dir == TD_RTL) std::swap(wx1, wx2);
|
if (_current_text_dir == TD_RTL) std::swap(wx1, wx2);
|
||||||
const uint shadow = _colour_gradient[COLOUR_GREY][3];
|
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 uint light = _colour_gradient[COLOUR_GREY][7];
|
||||||
const std::vector<Point> wedge{ Point{wx1, r.bottom - ha}, Point{wx2, r.top + ha}, Point{wx2, r.bottom - ha} };
|
const std::vector<Point> wedge{ Point{wx1, r.bottom - ha}, Point{wx2, r.top + ha}, Point{wx2, r.bottom - ha} };
|
||||||
GfxFillPolygon(wedge, fill);
|
GfxFillPolygon(wedge, fill);
|
||||||
GfxDrawLine(wedge[0].x, wedge[0].y, wedge[2].x, wedge[2].y, light);
|
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);
|
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);
|
GfxDrawLine(wedge[0].x, wedge[0].y, wedge[1].x, wedge[1].y, shadow, t);
|
||||||
|
|
||||||
/* Draw a slider handle indicating current value. */
|
/* Draw a slider handle indicating current value. */
|
||||||
const int sw = ScaleGUITrad(SLIDER_WIDTH);
|
const int sw = ScaleGUITrad(SLIDER_WIDTH);
|
||||||
|
Loading…
Reference in New Issue
Block a user