On 06.12.2017 17:02, Tavmjong Bah wrote:
Custom Gtk::Range widget couple with Gtk::Spinbutton:
This is my current favorite. It works quite well, methinks. Use the
'Alt' key to get into fine adjustment mode. It was rather simple to implement. Could be refined further (add styling properties, rounded corners, etc.).
This one needs a border around the slider area.
As Mark noted, Alt is often used for window manager gestures, so use of Ctrl and Shift (in that order, I'd say), is preferable.
Subclassed Gtk::Spinbutton:
This is essentially a modified version of the Gimp widget but it has
some major flaws as one cannot access the underlying widgets (ProgressBar, Buttons). In this example, the built in ProgressBar is disabled and new code that simulates a narrower ProgressBar has been added. I could not fine a good way to calculate how much narrower the new bar needs to be to not overlap the numerical entry part. Also, when dragging the bar it is easy to highlight the numerical text. The code to do all this is pretty messy.
This one does a good job in appearing as a single widget, but won't fly if the width of the numerical input can't be dealt with properly.
I note that in all functional cases, the value jumps to the pointer on mouse-down. That should be an alternative, the main mode should be just "sliding" the value. That has been the norm; did I miss examples to the contrary in recent closed software applications?
As Eduard points out, the width requirement of the horizontal - and + buttons is problematic. What's wrong with a vertical arrangement? If you feel adventurous, try the attached Python/GTK script to see another way of offering stepping buttons.