Files
David Richardson 774f1381d7 AppKit: Add appearance manager and effective appearance chain
Resolve effective appearance through view, superviews, window, appearance parent, application and system. Apply appearance theme state to each view at once, parent first. Lay out and draw each view under its effective appearance.

* _CPAppearanceManager.j: Add manager; derive system appearance from prefers-color-scheme, prefers-contrast and forced-colors media queries; notify application on change.

* CPAppearance.j: Add theme state composite and fallback order of nine appearances; add drawing appearance brackets; make application appearance default drawing appearance; decode shared instance by name.

* CPApplication.j: Adopt CPAppearanceCustomization; add appearance, effectiveAppearance and setAppearance:; pass changes to windows.

* CPWindow.j: Adopt CPAppearanceCustomization; inherit from attached sheet parent, parent window or application; pass changes to root views, child windows and sheet.

* _CPShadowWindowView.j: Take appearance of window view's window.

* _CPMenuWindow.j: Pass appearance to menu view and to menu item views outside view tree.

* CPView.j: Add effective appearance chain and viewDidChangeEffectiveAppearance; apply appearance state with KVO, layout and display; bracket layout and display with drawing appearance; resolve background colour under effective appearance; replace _currentAppearance with _appliedAppearance.

* CPTheme.j: Fall back through appearance order when no key with view's appearance state matches.

* _CPObject+Theme.j: Leave appearance states out of archived theme state.

* CPColor.j: Add -_resolvedColor to static colours.

* _CPImageAndTextView.j: Rewrite text colour on appearance change; compare CSS string as well as object in setTextColor:.

* CPImageView.j: Resolve image under effective appearance; apply image again on appearance change.

* CPPopover.j: Accept CPAppearance beside legacy integers; set effective appearance on popover window; archive appearance object under new key.

* _CPPopoverWindow.j: Remove integer appearance ivar and setter.

* _CPPopoverWindowView.j: Choose light or dark style from effective appearance.

* CPVisualEffectView.j: Remove own appearance setter; choose dark material from effective appearance.

* _CPCibWindowTemplate.j: Archive window appearance; set it on window before content view.

* CPSearchField.j: Bracket _layoutSubviews with effective appearance.

* CPButton.j, CPOutlineView.j, CPSearchField.j, CPSplitView.j, CPStackView.j, CPTextField.j, CPTokenField.j, _CPRuleEditorViewSliceRow.j: Send direct layout calls through _layoutSubviewsInEffectiveAppearance.

* _CPAppearanceManagerTest.j, CPApplicationAppearanceTest.j, CPWindowAppearanceTest.j, CPViewAppearanceTest.j, CPThemeAttributeAppearanceTest.j, CPVisualEffectViewTest.j, CPPopoverAppearanceTest.j: Add tests for system appearance, appearance chain, theme fallback, popover and visual effect view.

* CPAppearanceTest.j: Add tests for nil current appearance and decoded shared instance.

* CPViewTest.j: Expect application appearance as default effective appearance.

* Manual/CPAppearanceTest: Add application with asset catalog colour and image for each appearance.
2026-11-10 15:52:55 -06:00
..
2013-01-23 15:48:55 +07:00
2010-11-19 00:07:37 -03:00
2013-02-12 22:29:31 -05:00