Difference between revisions of "Cocoa Internals/Theme"

From Free Pascal wiki
Jump to navigationJump to search
m (Rationalised macOS categories)
m (Rationalised macOS categories)
Line 28: Line 28:
 
* https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/DrawColor/Tasks/SystemTintAware.html  
 
* https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/DrawColor/Tasks/SystemTintAware.html  
  
[[Category:Mac OS]]
+
[[Category:macOS]]
 
[[Category:Cocoa]]
 
[[Category:Cocoa]]

Revision as of 10:42, 16 December 2019

There are 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 Highlight Color

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

Aqua Theme vs Dark Mode

The initial functionality is available 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