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 678108 - Introduce GtkSpinSelection: a streamlined widget to select an option within a range
Introduce GtkSpinSelection: a streamlined widget to select an option within a...
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: Other
3.5.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-06-14 15:25 UTC by Carlos Garnacho
Modified: 2014-09-16 03:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GtkSpinSelection implementation and minimal test (42.50 KB, patch)
2012-06-14 15:25 UTC, Carlos Garnacho
none Details | Review
screenshot to get an idea (3.46 KB, image/png)
2012-06-14 15:26 UTC, Carlos Garnacho
  Details

Description Carlos Garnacho 2012-06-14 15:25:56 UTC
Created attachment 216423 [details] [review]
GtkSpinSelection implementation and minimal test

Hey,

Currently in order to allow selecting a value within a GtkAdjustment provided range, one has to use either a GtkSpinButton or a GtkScale, in places where keyboard editability doesn't matter (eg. the values are granular enough) and size/touch-friendliness prime, both unfortunately have shortcomings (GtkSpinButton indeed improved a lot in 3.4, it's mostly about the GtkEntry and how much space it takes wrt the tinier touch targets).

So I'm attaching a patch to introduce GtkSpinSelection, it's similar in API and spirit to GtkSpinButton, just that it's not keyboard editable (nav keys do obviously work), has bigger targets and allows panning up/down to change the selection. It also has a ::format-value vmethod to override the displayed value. It could be used for clock/calendar selections, also looks like a nice replacement for combobox-as-zoom-control in apps like evince

Still in the TODO:
- docs
- a11y
- probably makes sense to have this widget be a GtkOrientable
Comment 1 Carlos Garnacho 2012-06-14 15:26:41 UTC
Created attachment 216424 [details]
screenshot to get an idea
Comment 2 André Klapper 2012-06-26 12:31:22 UTC
Comment on attachment 216423 [details] [review]
GtkSpinSelection implementation and minimal test

[Patch => setting "patch" flag and correct mimetype]
Comment 3 Benjamin Otte (Company) 2012-08-31 14:41:04 UTC
There's a lot of conceptual ideas I'm not sure about.

First of all, GtkAdjustment.
For me an adjustment has always represented a continuous range, while this sounds a lot more like selecting 1 out of N different possibilities. In particular, the values aren't even related numerically to each other - like zoom having "fit page size" and similar.
Also, I think GtkAdjustment is a terrible API and we should try to get rid of it and not try to write more widgets supporting it. For example, I can't imagine how this widget would use step vs page sizes usefully.

Second, to me this just looks like a combobox (or at least an optionmenu). A set of values and one is selected. Granted, the current combobox API encourages opening the list to select a value, but couldn't you just redesign its UI to encourage flipping (o mouse-wheeling) more? In that case, we wouldn't need another widget and could just reuse the combobox. We'd also get working keynav and a11y already for free.
Comment 4 Matthias Clasen 2014-09-16 03:53:37 UTC
pan up/down have been added to gtkspinbutton now; so maybe this is no longer needed