Skip to content
  • Cosimo Cecchi's avatar
    spinbutton: paint an additional slice of background · 55642822
    Cosimo Cecchi authored
    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.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=683511
    55642822