Cocoa Internals/Theme

From Lazarus wiki
Revision as of 07:24, 8 January 2019 by Skalogryz (talk | contribs) (Created page with "There're several types of "Themes" in macOS. ==System Wide Themes== ===Tint=== The tint is a small change of highlighting colors. Historically it has been only 2 colors availa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

There're several types of "Themes" in macOS.

System Wide Themes

Tint

The tint is a small change of highlighting colors. Historically it has been only 2 colors available:

  • Blue
  • Graphite

As of today the functionality is still available in macOS, yet deprecated, as it has been suppressed by "Accent Color"

Accent aka Hihglight Color

Introduced in macOS 10.13 - the system-wide highlight color change

Aqua Theme vs Dark Mode

The initial functionality is availablie in 10.13. The system preferences are allowing to change the main bar to the dark mode. However APIs are available to change window and/or view

The full potential has been released in 10.14 Mojave.

Themed Controls Drawing API

The Cocoa doesn't have an explicit API to draw part of controls. (Carbon did provide HITheme interface. It still seems to be available for 64-bit ? really??, yet goes undocumented).

In order to draw a part of a control on a view, a "hidden" control could be created and then drawn to the target context. The similar approach is used for Printing controls to a printer.

The same might work with NSCells, yet Apple deprecates NSCells.

See Also