WindowThemePolicy
public enum WindowThemePolicy
Window theme policies that define which windows should be automatically themed, if any.
Swift
By default, all application windows (except NSPanel
) will be themed (.themeAllWindows
).
themeAllWindows
: Theme all application windows, exceptNSPanel
subclasses (default).themeSomeWindows
: Only theme windows of the specified classes.doNotThemeSomeWindows
: Do not theme windows of the specified classes.doNotThemeWindows
: Do not theme any window.E.g.:
E.g.:
ThemeManager.shared.windowThemePolicy = .themeSomeWindows(windowClasses: [CustomWindow.self])
Objective-C
By default, all application windows (except NSPanel
) will be themed (TKThemeManagerWindowThemePolicyThemeAllWindows
).
TKThemeManagerWindowThemePolicyThemeAllWindows
: Theme all application windows, exceptNSPanel
subclasses (default).TKThemeManagerWindowThemePolicyThemeSomeWindows
: Only theme windows of the specified classes (usethemableWindowClasses
property).TKThemeManagerWindowThemePolicyDoNotThemeSomeWindows
: Do not theme windows of the specified classes (usenotThemableWindowClasses
property).TKThemeManagerWindowThemePolicyDoNotThemeWindows
: Do not theme any window.
Example:
[TKThemeManager sharedManager].windowThemePolicy = TKThemeManagerWindowThemePolicyThemeSomeWindows;
[TKThemeManager sharedManager].themableWindowClasses = @[[CustomWindow class]];
NSWindow Extension
-
Theme window if appearance needs update. Doesn’t check for policy compliance.
NSWindow.isCompliantWithWindowThemePolicy()
Check if window complies to current policy.
NSWindow.themeIfCompliantWithWindowThemePolicy()
Theme window if compliant to
windowThemePolicy
(and if appearance needs update).-
Theme all windows compliant to ThemeManager.windowThemePolicy (and if appearance needs update).
-
Theme all application windows (default).
Declaration
Swift
case themeAllWindows
-
Only theme windows of the specified classes.
Declaration
Swift
case themeSomeWindows(windowClasses: [AnyClass])
-
Do not theme windows of the specified classes.
Declaration
Swift
case doNotThemeSomeWindows(windowClasses: [AnyClass])
-
Do not theme any window.
Declaration
Swift
case doNotThemeWindows