NSWindow
NSWindow
ThemeKit extension.
-
Any window specific theme.
This is, usually,
nil
, which means the current global theme will be used. Please note that when using window specific themes, only the associatedNSAppearance
will be automatically set. All theme aware assets (ThemeColor
,ThemeGradient
andThemeImage
) should call methods that returns a resolved color instead (which means they don’t change with the theme change, you need to observe theme changes manually, and set colors afterwards):ThemeColor.color(for view:, selector:)
ThemeGradient.gradient(for view:, selector:)
ThemeImage.image(for view:, selector:)
Additionaly, please note that system overriden colors (
NSColor.*
) will always use the global theme.Declaration
Swift
@objc public var windowTheme: Theme?
-
Returns the current effective theme (read-only).
Declaration
Swift
@objc public var windowEffectiveTheme: Theme
-
Returns the current effective appearance (read-only).
Declaration
Swift
@objc public var windowEffectiveThemeAppearance: NSAppearance?
-
Theme window if needed.
Declaration
Swift
@objc public func theme()
-
Theme window if compliant to ThemeManager.windowThemePolicy (and if needed).
Declaration
Swift
@objc public func themeIfCompliantWithWindowThemePolicy()
-
Theme all windows compliant to ThemeManager.windowThemePolicy (and if needed).
Declaration
Swift
@objc public static func themeAllWindows()