Our handling of default button borders doesn't match GTK

RESOLVED FIXED in mozilla1.9.2a1

Status

()

Core
Widget: Gtk
RESOLVED FIXED
9 years ago
8 years ago

People

(Reporter: Michael Ventnor, Assigned: Michael Ventnor)

Tracking

Trunk
mozilla1.9.2a1
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

9 years ago
Created attachment 385726 [details] [diff] [review]
Patch

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+
(Assignee)

Updated

9 years ago
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/43d32542e98c
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Keywords: checkin-needed → 4xp
Resolution: --- → FIXED
Keywords: 4xp

Updated

9 years ago
Depends on: 503863

Updated

8 years ago
Target Milestone: --- → mozilla1.9.2a1
You need to log in before you can comment on or make changes to this bug.