Closed Bug 1671704 Opened 4 years ago Closed 4 years ago

Support drawing native macOS scrollbars in the non-native ("basic") theme

Categories

(Core :: Widget: Cocoa, task)

All
macOS
task

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(5 files, 5 obsolete files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

This is the macOS part of bug 1671703: Give nsNativeBasicTheme the ability to draw scrollbars that look like native macOS scrollbars.

The patch in bug 1670023 already implements native-looking macOS scrollbars using manual drawing code. The patches in this bug will build on that patch and make the code usable from nsNativeBasicTheme.

Depends on: 1670023

Depends on D93840

Depends on D93841

Depends on D93842

This makes the basic theme use macOS scrollbars on all platforms.
When we add support for the other platform drawing styles, we should make
nsNativeBasicTheme pick the appropriate style for the platform. And it may make
sense to allow overriding the scrollbar style with a pref, so that we can test
another platform's drawing code during development.

Depends on D93844

Depends on: 1672044

Comment on attachment 9182110 [details]
Bug 1671704 - Create a path that draws native widgets using DrawTarget instead of CGContext. r=haik

Revision D93840 was moved to bug 1672044. Setting attachment 9182110 [details] to obsolete.

Attachment #9182110 - Attachment is obsolete: true

Comment on attachment 9182111 [details]
Bug 1671704 - Convert DrawScrollbarTrack to use DrawTarget. r=haik

Revision D93841 was moved to bug 1672044. Setting attachment 9182111 [details] to obsolete.

Attachment #9182111 - Attachment is obsolete: true

Comment on attachment 9182112 [details]
Bug 1671704 - Convert DrawScrollCorner to use DrawTarget. r=haik

Revision D93842 was moved to bug 1672044. Setting attachment 9182112 [details] to obsolete.

Attachment #9182112 - Attachment is obsolete: true

Comment on attachment 9182113 [details]
Bug 1671704 - Convert DrawScrollbarThumb to use DrawTarget. r=haik

Revision D93843 was moved to bug 1672044. Setting attachment 9182113 [details] to obsolete.

Attachment #9182113 - Attachment is obsolete: true
Depends on: 1673120
Depends on: 1673121

Comment on attachment 9182114 [details]
Bug 1671704 - Extract out scrollbar drawing from nsNativeThemeCocoa so that it can later be used by nsNativeBasicTheme. r=spohl

Revision D93844 was moved to bug 1673120. Setting attachment 9182114 [details] to obsolete.

Attachment #9182114 - Attachment is obsolete: true

The Mac theme will need this to check for RTL, and for whether the scrollbar has
the hover attribute, and for whether the scrollbar is on a dark background.

It looks like the philosophy of the virtual DrawScrollbar* methods was to supply
narrow pieces of information, instead of the frame itself. So this patch undoes
that separation of concerns.
In theory, we could grab the three pieces of state in
nsNativeBasicTheme::DrawWidgetBackground, but then we'd do a bunch of
computations (especially the "dark background" check) unnecessarily on platforms
that don't need them.

Depends on D95076

Attachment #9182116 - Attachment description: Bug 1671704 - Draw macOS scrollbars in nsNativeBasicTheme. r=spohl → Bug 1671704 - Draw macOS native-looking scrollbars when using the basic theme on macOS. r=spohl
Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/9c8614b77039
Remove IsSmallScrollbar. r=spohl
https://hg.mozilla.org/integration/autoland/rev/8b1e958d3ca0
Unify some calls to ComputeScrollbarParams and call nsLayoutUtils::StyleForScrollbar in the caller. r=spohl
https://hg.mozilla.org/integration/autoland/rev/6b6ed1e26874
Give scrollbar painting functions access to the nsIFrame*. r=spohl
https://hg.mozilla.org/integration/autoland/rev/a5ea7d2c2065
Add nsNativeBasicTheme::PaintScrollbarTrack which does nothing by default. r=spohl
https://hg.mozilla.org/integration/autoland/rev/2c47983a0673
Draw macOS native-looking scrollbars when using the basic theme on macOS. r=spohl
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: