Closed Bug 1697350 Opened 4 years ago Closed 4 years ago

Simplify NSCell focus ring drawing situation

Categories

(Core :: Widget: Cocoa, defect, P1)

All
macOS
defect

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(1 file, 1 obsolete file)

We have some old code in nsNativeThemeCocoa.mm which has a bunch of different paths for making sure we draw the right focus rings in the right cases. We can simplify this code considerably.

This blocks bug 1077365 because it's necessary for proper NSTextFieldCell focus rings, and it blocks bug 1697336 because that bug switches the style of the search field cell in the library toolbar, and its focus ring will look wonky without this fix.

Blocks: 1697565

We use these searchfields in the bookmarks sidebar, and in the toolbar in the
bookmarks library window.

The old code was a workaround for missing focus rings.
It turns out that NSTextFieldCell only draws focus rings if the object passed
to inView: is an NSControl. So if we make CellDrawView inherit from NSControl,
we get the focus ring.

Depends on D107751

We use these searchfields in the bookmarks sidebar, and in the toolbar in the
bookmarks library window.

The old code was a workaround for missing focus rings.
It turns out that NSTextFieldCell only draws focus rings if the object passed
to inView: is an NSControl. So if we make CellDrawView inherit from NSControl,
we get the focus ring.

Depends on D107907

Attachment #9208222 - Attachment is obsolete: true
Pushed by mstange@themasta.com: https://hg.mozilla.org/integration/autoland/rev/808f023d33cc Simplify focus ring drawing code for search fields. r=mac-reviewers,haik
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
Regressions: 1700839
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: