Theme QML Type
A singleton providing the global Fluent Design theme configuration. More...
| Import Statement: | import FluentUI.Controls 1.0 |
Properties
- accentColor : AccentColor
- animationCurve : int
- dark : bool
- darkMode : int
- darkResource : ColorResource
- fastAnimationDuration : int
- fasterAnimationDuration : int
- lightResource : ColorResource
- mediumAnimationDuration : int
- primaryColor : var
- res : ColorResource
- slowAnimationDuration : int
- textRender : int
- tooltipDelay : int
Methods
- color buttonColor(object button, bool transparentWhenNone, bool isDark)
- color checkedInputColor(object button, color accentColor, bool isDark)
- ColorResource of(object control)
- ColorResource ofAccentColor(color accentColor)
- ColorResource ofDark(bool isDark)
- color uncheckedInputColor(object button, bool transparentWhenNone, bool transparentWhenDisabled, bool isDark)
Detailed Description
Theme is the central singleton for managing the visual theme of a FluentUI application. It controls dark mode, primary and accent colors, animation timing, easing curves, and the color resource tables used by all controls. It provides utility methods for resolving theme-dependent colors.
Property Documentation
accentColor : AccentColor
The resolved accent color object based on primaryColor. This property is read-only.
animationCurve : int
The default easing curve for animations. Defaults to Easing.OutCubic.
dark : bool
Holds whether the current effective theme is dark. This property is read-only and updated automatically based on darkMode.
darkMode : int
The dark mode setting. Accepts FluentUI.System (follow system preference), FluentUI.Light (always light), or FluentUI.Dark (always dark).
darkResource : ColorResource
The color resource table used when the dark theme is active. Can be customized to override specific dark theme colors.
fastAnimationDuration : int
The duration for standard quick animations in milliseconds. Defaults to 167.
fasterAnimationDuration : int
The duration for fast micro-interactions in milliseconds. Defaults to 83.
lightResource : ColorResource
The color resource table used when the light theme is active. Can be customized to override specific light theme colors.
mediumAnimationDuration : int
The duration for medium-length animations in milliseconds. Defaults to 250.
primaryColor : var
The primary accent color used throughout the application. This can be a named color, a hex value, or one of the predefined color resources.
res : ColorResource
The current color resource table containing semantic color tokens for the active theme. This property is read-only and updates automatically when the theme changes.
slowAnimationDuration : int
The duration for slower, more deliberate animations in milliseconds. Defaults to 358.
textRender : int
The text rendering quality. Defaults to TextEdit.QtRendering.
tooltipDelay : int
The delay before a tooltip appears, in milliseconds. Defaults to 800.
Method Documentation
color buttonColor(object button, bool transparentWhenNone, bool isDark)
Resolves the appropriate button color for the given button, optionally using transparency and the specified dark mode state.
color checkedInputColor(object button, color accentColor, bool isDark)
Resolves the color for a checked input control using the given accentColor and dark mode state.
ColorResource of(object control)
Returns the effective ColorResource for the given control, taking into account the current theme and any per-control overrides.
See also ofDark and ofAccentColor.
ColorResource ofAccentColor(color accentColor)
Returns a ColorResource adjusted to use the specified accentColor instead of the current theme accent color.
ColorResource ofDark(bool isDark)
Returns the ColorResource for either dark or light theme based on the isDark parameter, independent of the current effective theme.
color uncheckedInputColor(object button, bool transparentWhenNone, bool transparentWhenDisabled, bool isDark)
Resolves the color for an unchecked input control with the specified transparency and dark mode settings.