Skip to content

Commit

Permalink
Tweaked minimal slider magic numbers again so maximum value can be re…
Browse files Browse the repository at this point in the history
…ached (bug #24531)

There seems to possibly be an internal issue with the slider (and more generally, the
scrollbar implementation form which it inherits) where is min/maximum_positioner_length
equal an even number, sliders with an even number of options will reach max value.

Setting it to what, in this case is 1 below the actual width of the slider image (15)
means both even and odd-numbered sliders will reach max value, however the edge is cut off.

Attempting to set the right_offset to 1 and using the above off value for the positioned
width means only sliders with an odd number of options reach max value.

The magic numbers in this commit seem to give the widget enough space to reach the end of
the slider and max values regardless of the number of options, but the internal widget dimension
calculation should perhaps be investigated in the future.
  • Loading branch information
Vultraz committed Jul 28, 2016
1 parent 6c98f52 commit 9f3639d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions data/gui/widget/slider_minimal.cfg
Expand Up @@ -15,7 +15,7 @@
[line]
x1 = 0
y1 = "(height / 2)"
x2 = "(width - 2)"
x2 = "(width - 4)"
y2 = "(height / 2)"

color = {GROOVE_COLOR}
Expand Down Expand Up @@ -53,7 +53,7 @@
minimum_positioner_length = {POSITIONER_LENGTH}
maximum_positioner_length = {POSITIONER_LENGTH}

right_offset = 2
right_offset = 3

#text_font_size = 1 # placeholder

Expand Down Expand Up @@ -92,7 +92,7 @@
id = "minimal"
description = "A slider without a value label."

{_GUI_RESOLUTION () 150 250 22 15 }
{_GUI_RESOLUTION () 150 250 22 16 }

[/slider_definition]

Expand Down

0 comments on commit 9f3639d

Please sign in to comment.