GNOME Bugzilla – Bug 683168
Make spinbutton orientable
Last modified: 2012-09-03 15:47:33 UTC
It would be cool if spinbutton could be oriented: by making it vertical you would get something like: + ----- 12 ----- - which is better in some cases, especially when you need to input a "composite" number made of more digits independently edited. In particular I would use it to enter hh:mm in a clock, but other cases come to mind (complex numbers, secret combination, etc) A patch by me and Cosimo follows (he will attach it since he is the one who figured out the GtkEntry changes)
Created attachment 223154 [details] [review] Make spinbutton orientable In order to implement this, we also need to make the get_frame_size method of GtkEntry overridable from a subclass (like get_text_area_size).
Review of attachment 223154 [details] [review]: ::: gtk/gtkentry.h @@ -115,2 +121,2 @@ /* Padding for future expansion */ void (*_gtk_reserved1) (void); we need to remove one of the padding slots ::: tests/testspinbutton.c @@ -43,1 @@ GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2); (we need to remove this quick hack)
Created attachment 223161 [details] [review] Make spinbutton orientable -- - adds correct nth-child support - fixes some requisition/allocation bugs - adds a separate window in the test for the vertical case
Created attachment 223162 [details] screenshot Screenshot with a patched theme
Created attachment 223228 [details] [review] Make spinbutton orientable -- Fix some compiler warnings
Created attachment 223229 [details] [review] entry: fix requisition width/height to use the current pango layout This way, we can ensure that width/height changes due to the use of gtk_entry_set_attributes() are correctly reflected in the size request. -- I think this patch is generally needed independently of this feature; right now entries or spinbuttons that are set custom pango attributes don't change the frame size.
Created attachment 223334 [details] [review] Make spinbutton orientable -- Some minor fixes
Created attachment 223335 [details] [review] entry: fix requisition width/height to use the current pango layout This way, we can ensure that width/height changes due to the use of gtk_entry_set_attributes() are correctly reflected in the size request.
Review of attachment 223335 [details] [review]: works fine in my testing
Review of attachment 223334 [details] [review]: nice
Attachment 223334 [details] pushed as afd99d3 - Make spinbutton orientable Attachment 223335 [details] pushed as d05191a - entry: fix requisition width/height to use the current pango layout Pushed to master, thanks!