GNOME Bugzilla – Bug 683511
spinbutton: fix xthickness bug when resizing the text area size
Last modified: 2013-01-25 22:26:00 UTC
See attached patch, against GTK2.
Created attachment 223664 [details] [review] spinbutton: fix xthickness bug when resizing the text area size Since we draw the right side (or left side in RTL) of the spinbutton manually, putting a panel in it, we don't have any way to render that side of the border over the xthickness area (like GtkEntry does). To avoid leaving an unpainted area close to the text area, we need to compensate for this when returning the text area size up from the spinbutton.
Created attachment 234449 [details] [review] spinbutton: paint an additional slice of background Normally, the xthickness in the style maps to the space on the sides of the widget, to accommodate for its border - GtkEntry's text area background width is calculated as (allocation->width - 2 * xthickness), and the border is rendered in that area. GtkSpinButton has an additional panel for the buttons though, which will render the right-side (left-side for RTL) border itself, taking xthickness into account. This results in the xthickness for that side being applied twice, both to the spinbutton panel and to the entry's text area. Visually, a slice with no painted background can be seen in spinbuttons on the right side (left side when RTL) of the text area, where the border would be rendered by the entry, which looks bad. This patch makes GtkSpinButton render the same background of the entry in that slice, to compensate for the xthickness being allocated to the button panel instead.
Attachment 234449 [details] pushed as 5564282 - spinbutton: paint an additional slice of background