texus / TGUI

Cross-platform modern c++ GUI

Home Page:https://tgui.eu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Horizontal scrollbar thumb position may change on mouse down/up event over thumb

pdhahn opened this issue · comments

I have tried out the many_different_widgets program. Very nice! But I did observe one glitch: (see subject line).

I built from the latest TGUI github source today (2017/11/05) on CentOS 6.x on my old 64bit Intel Xeon-based Dell 670 Workstation, using g++ 5.1.0. Here's info from uname -a:

Linux 2.6.32-696.13.2.el6.centos.plus.x86_64 #1 SMP Fri Oct 6 15:03:31 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

My SFML version is 2.4.2.

I actually see the same issue in TGUI 0.7.4 (full_example).

Never mind, I see now it is snapping to the nearest integer value when the mouse left button is released.

I am wondering if you would consider adding a "continuous" slider widget class (based on a float value as opposed to an integer value)? This could also implement snap-to-tickmark as an option.

It's a good idea. It's also more fun to implement than what I was working on, so I did it right away 😄. I didn't add another widget but simply changed the current Slider class to float values. By default it will still round to integer values but this can be changed with the new setFrequency function. If you e.g. set the frequency to 2 then the slider will only use even values and by calling setFrequency(0) you get the continuous slider.