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 683511 - spinbutton: fix xthickness bug when resizing the text area size
spinbutton: fix xthickness bug when resizing the text area size
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-09-06 15:42 UTC by Cosimo Cecchi
Modified: 2013-01-25 22:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
spinbutton: fix xthickness bug when resizing the text area size (1.41 KB, patch)
2012-09-06 15:42 UTC, Cosimo Cecchi
none Details | Review
spinbutton: paint an additional slice of background (3.00 KB, patch)
2013-01-25 22:20 UTC, Cosimo Cecchi
committed Details | Review

Description Cosimo Cecchi 2012-09-06 15:42:05 UTC
See attached patch, against GTK2.
Comment 1 Cosimo Cecchi 2012-09-06 15:42:07 UTC
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.
Comment 2 Cosimo Cecchi 2013-01-25 22:20:04 UTC
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.
Comment 3 Cosimo Cecchi 2013-01-25 22:25:58 UTC
Attachment 234449 [details] pushed as 5564282 - spinbutton: paint an additional slice of background