After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 563688 - GtkScale (GtkRange) should jump to clicked position
GtkScale (GtkRange) should jump to clicked position
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.19.x
Other All
: Normal normal
: ---
Assigned To: Christian Dywan
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-12-08 13:56 UTC by Christian Dywan
Modified: 2013-01-18 21:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Introduce "relative-steps" (6.13 KB, patch)
2008-12-08 13:59 UTC, Christian Dywan
reviewed Details | Review
Introduce jump-to-position (6.25 KB, patch)
2008-12-16 15:34 UTC, Christian Dywan
none Details | Review
Only implement the jump-to-position property (3.52 KB, patch)
2009-09-03 14:27 UTC, Christian Dywan
none Details | Review
Make GtkScale jump to clicked position instead of stepping (6.56 KB, patch)
2012-03-16 10:10 UTC, Lars Karlitski
none Details | Review
Make GtkRange jump to clicked position instead of stepping (5.00 KB, patch)
2012-03-16 10:32 UTC, Lars Karlitski
none Details | Review
Change button bindings for range widgets around (2.19 KB, patch)
2012-04-26 20:36 UTC, Matthias Clasen
none Details | Review
Add a 'fine adjustment' mode to ranges (3.32 KB, patch)
2012-04-26 21:52 UTC, Matthias Clasen
none Details | Review
better patch (4.01 KB, patch)
2012-04-27 01:20 UTC, Matthias Clasen
none Details | Review

Description Christian Dywan 2008-12-08 13:56:21 UTC
It would be nice if GtkScale supported jumping directly to the position the user clicks, that is instead of moving the number of steps towards the desired position.  This feature is actually used on mobile devices.
Comment 1 Christian Dywan 2008-12-08 13:59:59 UTC
Created attachment 124165 [details] [review]
Introduce "relative-steps"

I implemented the new property "relative-steps". If it is set to FALSE, a single click has the same effect as currently middle click. The key difference is however that touchscreen devices usually have only a normal click.
Comment 2 Matthias Clasen 2008-12-14 00:10:46 UTC
I'd be more sympathetic if this would use gtk-touchscreen-mode rather than adding yet another knob.
Comment 3 Christian Dywan 2008-12-16 15:34:20 UTC
Created attachment 124799 [details] [review]
Introduce jump-to-position

I improved the patch a little with suggestions from Mitch, and renamed the property "jump-to-position", which seems to be a much better name.

I don't see how this behaviour would be related to touch screens.
Comment 4 Matthias Clasen 2008-12-21 07:09:08 UTC
You mentioned touch screens yourself. It doesn't make much sense to me to add this as a random behaviour-changing property.
Comment 5 Christian Dywan 2008-12-21 23:39:24 UTC
(In reply to comment #4)
> You mentioned touch screens yourself. It doesn't make much sense to me to add
> this as a random behaviour-changing property.

Oops, bad wording on my side. What I actually meant was, it is not specific to touch screens. Granted, my use case is about a touch screen. Yet it would make perfect sense even on a workstation and in fact it would be just as useful on a mobile device to let it move relatively.

As an alternative, I could imagine a GtkSettings value, since to me it's clearly about platform behaviour. However I am not sure if it makes sense that all sub classes should adapt then, ie. whether scrollbars should also jump. And I don't think e.g GtkScale could easily implement the feature as opposed to GtkRange.
Comment 6 Christian Dywan 2009-09-03 14:27:47 UTC
Created attachment 142409 [details] [review]
Only implement the jump-to-position property

I stripped the patch down to the property and no functions and added a note that it should be used in subclasses of GtkRange. So whenever the behaviour is desirable, a subclass can enable it easily. This avoids the question of subclasses, ie we want it in scales but not in scrollbars.
Comment 7 Christian Dywan 2009-11-13 11:31:53 UTC
The patch still compiles. Any chance for an opinion on the updated patch?
Comment 8 Christian Giordano 2012-03-13 17:04:19 UTC
Middle click is not discoverable and a slider shouldn't be necessary consistent with scrollbars. All sliders on the web use left click to jump. Please accept this patch!
Comment 9 William Jon McCann 2012-03-13 17:28:29 UTC
Also see bug 137812.
Comment 10 Lars Karlitski 2012-03-16 10:10:46 UTC
Created attachment 209908 [details] [review]
Make GtkScale jump to clicked position instead of stepping

Attached is a slightly modified version of Christian's patch.  It works with current gtk+ master and sets 'jump-to-position' to default for GtkScales.

The topic of making scrollbars behave the same was brought up in irc, but I don't know what the final decision was.  If they should behave the same, 'jump-to-position' could be set to default unconditionally.

Also, we might want to think about leaving the stepping behavior for windows builds, as that is how sliders typically behave on windows.  How is conditionally enabling such a feature for a platform usually handled?
Comment 11 Christian Giordano 2012-03-16 10:15:04 UTC
@Lars, GNOME designers clearly expressed the desire to change the behavior of the scrollbars at the same time. So that Slider and Scrollbars behave in the same way.
Comment 12 Christian Giordano 2012-03-16 10:16:18 UTC
The same way being jumping on left-click.
Comment 13 Lars Karlitski 2012-03-16 10:32:11 UTC
Created attachment 209910 [details] [review]
Make GtkRange jump to clicked position instead of stepping

Thanks for the clarification, Christian.  I've updated the patch to make 'jump-to-position' be the default.
Comment 14 William Jon McCann 2012-04-26 03:51:16 UTC
(In reply to comment #13)
> Created an attachment (id=209910) [details] [review]
> Make GtkRange jump to clicked position instead of stepping
> 
> Thanks for the clarification, Christian.  I've updated the patch to make
> 'jump-to-position' be the default.

Just tried this out and, in general, I really like the behavior. There is one thing that feels pretty odd though.

It doesn't seem to differentiate between clicks on the handle of a scrollbar or unmarked (round handle in Adwaita) range widget and the trough. So, it results in the scroll view or scale selection jumping suddenly as I reach for the drag handle.
Comment 15 Matthias Clasen 2012-04-26 20:36:12 UTC
Created attachment 212912 [details] [review]
Change button bindings for range widgets around

It seems to be general consensus that button 1 should do the jumping,
so we now jump to the clicked position on primary button clicks and
page on secondary button clicks. Touch behaves like primary.
Comment 16 Matthias Clasen 2012-04-26 21:52:24 UTC
Created attachment 212916 [details] [review]
Add a 'fine adjustment' mode to ranges

Shift-click in the slider now starts a drag in 'fine adjustment'
mode, where we move the slider 10-times slower than the mouse.

This can be very helpful when scrolling through a very long document
or webpage, and moving the scrollbar even a single pixel already
jumps too far in the content.
Comment 17 Matthias Clasen 2012-04-27 01:20:12 UTC
Created attachment 212924 [details] [review]
better patch
Comment 18 Matthias Clasen 2012-04-27 16:09:16 UTC
Pushed this for now.
Comment 19 Adam Williamson 2013-01-18 21:18:10 UTC
for the record: when this change suddenly showed up on my system's scrollbars (not sure why it only popped up now), I found this disconcerting and not any kind of improvement. I can live with retraining myself to right click on all my scrollbars, but that's what I'm going to do, and it is an inconvenience to me, not an improvement. ajax says much the same.