GNOME Bugzilla – Bug 663359
spinbutton: redesign to use an horizontal layout
Last modified: 2017-06-04 01:17:46 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).
Created attachment 200648 [details] [review] spinbutton: redesign to use an horizontal layout Change the GtkSpinButton layout to be horizontal. This is more touch-friendly.
Created attachment 200649 [details] [review] theme patch Patch to test with Adwaita
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.
(If it wasn't clear, the whole point of this exercise is to make GtkSpinButton touchscreen-friendly)
See bug 659388 for discussion of various tradeoffs
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
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.
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
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).
Created attachment 201967 [details] rtl mode
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.
the windows are actually input-only already
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 ?
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.
*** Bug 659388 has been marked as a duplicate of this bug. ***
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.