Difference between revisions of "Cocoa Internals/Theme"

From Lazarus wiki
Jump to navigationJump to search
(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...")
 
m (Fixed typos; Added categories)
Line 1: Line 1:
There're several types of "Themes" in macOS.
+
There are several types of "Themes" in macOS.
 +
 
 
==System Wide Themes==
 
==System Wide Themes==
 +
 
===Tint===
 
===Tint===
 
The tint is a small change of highlighting colors. Historically it has been only 2 colors available:
 
The tint is a small change of highlighting colors. Historically it has been only 2 colors available:
Line 6: Line 8:
 
* Graphite
 
* Graphite
 
As of today the functionality is still available in macOS, yet deprecated, as it has been suppressed by "Accent Color"
 
As of today the functionality is still available in macOS, yet deprecated, as it has been suppressed by "Accent Color"
===Accent aka Hihglight Color===
+
 
 +
===Accent aka Highlight Color===
 
Introduced in macOS 10.13 - the system-wide highlight color change
 
Introduced in macOS 10.13 - the system-wide highlight color change
 +
 
===Aqua Theme vs Dark Mode===
 
===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 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.  
 
The full potential has been released in 10.14 Mojave.  
 +
 
==Themed Controls Drawing API==
 
==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).
 
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).
Line 19: Line 24:
  
 
The same might work with NSCells, yet Apple deprecates NSCells.
 
The same might work with NSCells, yet Apple deprecates NSCells.
 +
 
==See Also==
 
==See Also==
 
* 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:Mac OS X]]
 
[[Category:Cocoa]]
 
[[Category:Cocoa]]

Revision as of 09:45, 19 August 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