Closed Bug 501104 Opened 15 years ago Closed 15 years ago

Our handling of default button borders doesn't match GTK

Categories

(Core :: Widget: Gtk, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: ventnor.bugzilla, Assigned: ventnor.bugzilla)

References

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
The patch fixes 2 things:

1. We calculate the overflow rect for all buttons to include the default overflow. This could potentially cause a lot of unnecessary work, and I now know that GetWidgetOverflow is called every time, not just once for each widget type.
2. We don't calculate the default border correctly. There is actually a second property we need to read that GTK uses called "default-border", rather than just "default-outside-border".

GTK's button size allocation includes default-outside-border (if any), but it paints the default border then insets by default-border, not default-outside-border. So what we do is outset by default-outside-border, paint the default border, then inset by default-border. This makes us match GTK in the end, and also fixes themes that have their default border inside the button (they expect the default button itself to be slightly smaller, as is what GTK does). Such themes include the High Contrast theme.

I did have to move moz_gtk_button_paint, but the only changes are within the if(state->isDefault).

If all that was too much to comprehend, just get this: what we were doing before was wrong. This is right :-)
Attachment #385726 - Flags: superreview?(roc)
Attachment #385726 - Flags: review?(roc)
Attachment #385726 - Flags: superreview?(roc)
Attachment #385726 - Flags: superreview+
Attachment #385726 - Flags: review?(roc)
Attachment #385726 - Flags: review+
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/43d32542e98c
Status: NEW → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed4xp
Resolution: --- → FIXED
Depends on: 503863
Target Milestone: --- → mozilla1.9.2a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: