GUI: Increase position range for a slider value #5317
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This makes it so that half the space before and after a slider value is assigned to that value
Currently for sliders with small value range, the whole space between two consecutive values on the slider is "assigned" to the lower value. Hence, the only ways to set the slider to the highest value is to either use the mouse wheel scroll, or click and drag, or click at a pixel of the far edge of the slider, which is hard to do especially with direct touch interface.
This PR addresses the final option, making it a bit easier to get the final value when using simple clicks or direct touch. It still uses integer division to get the slider value from the click position, but "divides" the space between two values in half, assigning the first half to the left (smaller) value and the right half to the right (higher).
This was inspired mainly for touchsreen interfaces where simple tap is the main form of interaction (and mouse wheel or click and drag may not be supported or more difficult to pull through).
For a quick test, test with the slider in launcher's grid view for "icons per row" (which goes from 1 to 12).
On a mobile phone, you can also test in Global Options -> Control with the "Pointer Speed" slider (this was also reported in a tweet today), or the "Joy Deadzone" one.
For reference here's the tweet mentioning the issue: https://twitter.com/therealjbenam/status/1700121630972715165