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 663359 - spinbutton: redesign to use an horizontal layout
spinbutton: redesign to use an horizontal layout
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkSpinButton
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 659388 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-11-03 21:58 UTC by Cosimo Cecchi
Modified: 2017-06-04 01:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
spinbutton: redesign to use an horizontal layout (25.67 KB, patch)
2011-11-03 21:58 UTC, Cosimo Cecchi
none Details | Review
theme patch (730 bytes, patch)
2011-11-03 21:59 UTC, Cosimo Cecchi
none Details | Review
screenshot (14.35 KB, image/png)
2011-11-03 22:18 UTC, Cosimo Cecchi
  Details
spinbutton: redesign to use an horizontal layout (28.11 KB, patch)
2011-11-07 19:14 UTC, Cosimo Cecchi
none Details | Review
minor problem (62.48 KB, image/png)
2011-11-19 20:16 UTC, Matthias Clasen
  Details
spinbutton: redesign to use an horizontal layout (40.32 KB, patch)
2011-11-23 03:16 UTC, Cosimo Cecchi
committed Details | Review
screenshot (29.81 KB, image/png)
2011-11-23 03:18 UTC, Cosimo Cecchi
  Details
rtl mode (35.24 KB, image/png)
2011-11-23 03:18 UTC, Cosimo Cecchi
  Details

Description Cosimo Cecchi 2011-11-03 21:58:18 UTC
See attached (preliminary) patch.
Notes:
- Adwaita currently sets an uneven left/right padding to make the widget look decent, so it needs to be patched for this to render properly again
- It's probably worth adding "left" and "right" style classes to the spin buttons along the sides of the entry (easy improvement for a future patch).
Comment 1 Cosimo Cecchi 2011-11-03 21:58:19 UTC
Created attachment 200648 [details] [review]
spinbutton: redesign to use an horizontal layout

Change the GtkSpinButton layout to be horizontal. This is more
touch-friendly.
Comment 2 Cosimo Cecchi 2011-11-03 21:59:14 UTC
Created attachment 200649 [details] [review]
theme patch

Patch to test with Adwaita
Comment 3 Cosimo Cecchi 2011-11-03 22:18:21 UTC
Created attachment 200650 [details]
screenshot

Screenshot of the proposal.

Note that the buttons can have an additional background/frame style defined by the theme as well.
Comment 4 Cosimo Cecchi 2011-11-03 22:20:02 UTC
(If it wasn't clear, the whole point of this exercise is to make GtkSpinButton touchscreen-friendly)
Comment 5 Matthias Clasen 2011-11-04 03:36:18 UTC
See bug 659388 for discussion of various tradeoffs
Comment 6 Cosimo Cecchi 2011-11-07 19:14:30 UTC
Created attachment 200914 [details] [review]
spinbutton: redesign to use an horizontal layout

---

New version of the patch:
- refactors code to only calculate the allocated space by the left/right windows in one place
- tested RTL support
- add a "frame" style class, under which a border is rendered in the text area, clipped to stay inside the entry borders. This is visible in the mockups on gnome-design and it's generally a nice effect to have
Comment 7 Matthias Clasen 2011-11-19 20:16:26 UTC
Created attachment 201714 [details]
minor problem

I gave this a quick test; seems to work fine apart from the minor problem I've found in the font chooser.
Comment 8 Cosimo Cecchi 2011-11-23 03:16:22 UTC
Created attachment 201965 [details] [review]
spinbutton: redesign to use an horizontal layout

Rewrite GtkSpinButton to use a touchscreen friendly horizontal layout.
Other features include:
- support for theming buttons with nth-child
- full support for RTL
- use + and - symbolic icons instead of arrows
- general streamlining and cleanup of a lot of related code
Comment 9 Cosimo Cecchi 2011-11-23 03:18:23 UTC
Created attachment 201966 [details]
screenshot

Updated the patch to use the new button layout as discussed with the design team; this is how it looks like (with a patched theme).
Comment 10 Cosimo Cecchi 2011-11-23 03:18:47 UTC
Created attachment 201967 [details]
rtl mode
Comment 11 Matthias Clasen 2011-11-23 20:47:51 UTC
Hmm, I must say I'm not too thrilled with the doubling of the windows here. Could we make those input-only windows and just draw on the main window ? Of course, being a GtkEntry subclass might make that slightly more challenging.
Comment 12 Matthias Clasen 2011-11-24 20:26:04 UTC
the windows are actually input-only already
Comment 13 Matthias Clasen 2011-11-24 21:27:44 UTC
trying the latest patch without adwaita patch, I notice that there is a 'gap' at the far end between the + and the edge of the entry. I think it should be flush right, no ?
Comment 14 Cosimo Cecchi 2011-11-28 14:49:29 UTC
Attachment 201965 [details] pushed as 10cfa90 - spinbutton: redesign to use an horizontal layout

Pushed to master a slightly tweaked version of this, which ensures button panels are indeed always allocated to the end of the entry.
Comment 15 Javier Jardón (IRC: jjardon) 2011-11-28 14:59:36 UTC
*** Bug 659388 has been marked as a duplicate of this bug. ***
Comment 16 matheus4551 2017-06-04 01:17:46 UTC
I think this brough usability problems in specific cases. Some apps that need compact SpinButtons like GIMP will be compromised when it switches to GTK+ 3/4 by default. I suggest a hybrid mode when an app/theme can decide to use horizontal or the traditional, but space-saving vertical buttons.