# MacOSTheme

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-themes-macos/struct-macostheme/

**struct** · [`ferroui-themes-macos`](/docs/0.5.0/api/ferroui-themes-macos/) · v0.5.0

```rust
struct MacOSTheme
```

Includes the macOS 26 theme in an application.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L73)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`control_size_property`](#function-control_size_property)
- [`reduce_motion_property`](#function-reduce_motion_property)
- [`reduce_transparency_property`](#function-reduce_transparency_property)
- [`increase_contrast_property`](#function-increase_contrast_property)
- [`window_active_property`](#function-window_active_property)
- [`accent_color_property`](#function-accent_color_property)
- [`density_style_property`](#function-density_style_property)
- [`DOCUMENT_URI`](#assoc_const-document_uri)
- [`high_contrast`](#function-high_contrast)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`with_service_provider`](#function-with_service_provider)
- [`with_parts`](#function-with_parts)
- [`density_style`](#function-density_style)
- [`set_density_style`](#function-set_density_style)
- [`control_size`](#function-control_size)
- [`set_control_size`](#function-set_control_size)
- [`reduce_motion`](#function-reduce_motion)
- [`set_reduce_motion`](#function-set_reduce_motion)
- [`reduce_transparency`](#function-reduce_transparency)
- [`set_reduce_transparency`](#function-set_reduce_transparency)
- [`increase_contrast`](#function-increase_contrast)
- [`set_increase_contrast`](#function-set_increase_contrast)
- [`window_active`](#function-window_active)
- [`set_window_active`](#function-set_window_active)
- [`accent_color`](#function-accent_color)
- [`set_accent_color`](#function-set_accent_color)
- [`effective_reduce_motion`](#function-effective_reduce_motion)
- [`effective_reduce_transparency`](#function-effective_reduce_transparency)
- [`effective_increase_contrast`](#function-effective_increase_contrast)
- [`try_get_resource`](#function-try_get_resource)
- [`as_style`](#function-as_style)
- [`as_resource_provider`](#function-as_resource_provider)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L91)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<MacOSTheme>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L91)

<a id="function-control_size_property"></a>

### control_size_property

```rust
fn control_size_property() -> &'static DirectProperty<MacOSTheme, ControlSize>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L129)

<a id="function-reduce_motion_property"></a>

### reduce_motion_property

```rust
fn reduce_motion_property() -> &'static DirectProperty<MacOSTheme, bool>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L129)

<a id="function-reduce_transparency_property"></a>

### reduce_transparency_property

```rust
fn reduce_transparency_property() -> &'static DirectProperty<MacOSTheme, bool>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L129)

<a id="function-increase_contrast_property"></a>

### increase_contrast_property

```rust
fn increase_contrast_property() -> &'static DirectProperty<MacOSTheme, bool>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L129)

<a id="function-window_active_property"></a>

### window_active_property

```rust
fn window_active_property() -> &'static DirectProperty<MacOSTheme, bool>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L129)

<a id="function-accent_color_property"></a>

### accent_color_property

```rust
fn accent_color_property() -> &'static DirectProperty<MacOSTheme, Option<Color>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L129)

<a id="function-density_style_property"></a>

### density_style_property

```rust
fn density_style_property() -> &'static DirectProperty<MacOSTheme, DensityStyle>
```

Defines the `DensityStyle` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L129)

<a id="assoc_const-document_uri"></a>

### DOCUMENT_URI

```rust
const DOCUMENT_URI: &'static str
```

The URI of the document of the class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L163)

<a id="function-high_contrast"></a>

### high_contrast

```rust
fn high_contrast() -> ThemeVariant
```

Optional dark high-contrast variant. For increased contrast without changing
appearance, set `IncreaseContrast` and keep the light/dark requested variant.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L167)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```

Field initialisation; see `Styles::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L172)

<a id="function-new"></a>

### new

```rust
fn new() -> Ref<Self>
```

Creates the theme.
## Panics
Panics if the documents of the theme fail to load.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L188)

<a id="function-with_service_provider"></a>

### with_service_provider

```rust
fn with_service_provider(sp: Option<Rc<dyn IServiceProvider>>) -> Ref<Self>
```

Creates the theme; `sp` is the parent's service provider.

The full theme: every unit of its compiled markup. A later load of the theme by URI gets the
full theme too, unless the application registered the units it keeps.
## Panics
Panics if the documents of the theme fail to load, or if the loaded
document lacks the compact styles.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L200)

<a id="function-with_parts"></a>

### with_parts

```rust
fn with_parts(sp: Option<Rc<dyn IServiceProvider>>, parts: rt::ThemeParts) -> Ref<Self>
```

Creates the theme from some of the units of its compiled markup (#568, step 3 of
docs/porting/theme-trimming.md); `sp` is the parent's service provider.

`parts` are units of `crate::compiled_xaml::THEME_UNITS`, in canonical order (ascending
indices), with the ambient unit (index 0) first: the table an application's build writes
when it trims its themes (the default; `[package.metadata.ferroui] theme-trimming = false`
turns it off). The theme
applies those units, at the places of the full theme and in its order; a unit that `parts`
leaves out adds nothing. Only the units named are linked into the application. In debug
builds a lookup of a control theme that `parts` left out logs once that it was trimmed.
## Panics
Panics if the documents of the theme fail to load, or if `parts` leaves out the ambient
unit (index 0), which has the structure of the theme.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L220)

<a id="function-density_style"></a>

### density_style

```rust
fn density_style(self: &Self) -> DensityStyle
```

The density style of the theme (normal, compact).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L269)

<a id="function-set_density_style"></a>

### set_density_style

```rust
fn set_density_style(self: &Self, value: DensityStyle)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L273)

<a id="function-control_size"></a>

### control_size

```rust
fn control_size(self: &Self) -> ControlSize
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L277)

<a id="function-set_control_size"></a>

### set_control_size

```rust
fn set_control_size(self: &Self, value: ControlSize)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L278)

<a id="function-reduce_motion"></a>

### reduce_motion

```rust
fn reduce_motion(self: &Self) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L279)

<a id="function-set_reduce_motion"></a>

### set_reduce_motion

```rust
fn set_reduce_motion(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L280)

<a id="function-reduce_transparency"></a>

### reduce_transparency

```rust
fn reduce_transparency(self: &Self) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L281)

<a id="function-set_reduce_transparency"></a>

### set_reduce_transparency

```rust
fn set_reduce_transparency(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L282)

<a id="function-increase_contrast"></a>

### increase_contrast

```rust
fn increase_contrast(self: &Self) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L283)

<a id="function-set_increase_contrast"></a>

### set_increase_contrast

```rust
fn set_increase_contrast(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L284)

<a id="function-window_active"></a>

### window_active

```rust
fn window_active(self: &Self) -> bool
```

Applications hosting more than one window can install a theme per window
and bind this property to the window's activation state.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L287)

<a id="function-set_window_active"></a>

### set_window_active

```rust
fn set_window_active(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L288)

<a id="function-accent_color"></a>

### accent_color

```rust
fn accent_color(self: &Self) -> Option<Color>
```

`None` follows the platform accent; setting a color overrides it for this theme.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L290)

<a id="function-set_accent_color"></a>

### set_accent_color

```rust
fn set_accent_color(self: &Self, value: Option<Color>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L291)

<a id="function-effective_reduce_motion"></a>

### effective_reduce_motion

```rust
fn effective_reduce_motion(self: &Self) -> bool
```

Whether nonessential motion is disabled by this theme or the platform.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L294)

<a id="function-effective_reduce_transparency"></a>

### effective_reduce_transparency

```rust
fn effective_reduce_transparency(self: &Self) -> bool
```

Whether glass must use the opaque fallback, including the system preference.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L299)

<a id="function-effective_increase_contrast"></a>

### effective_increase_contrast

```rust
fn effective_increase_contrast(self: &Self) -> bool
```

Increased contrast preserves the selected light or dark appearance.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L304)

<a id="function-try_get_resource"></a>

### try_get_resource

```rust
fn try_get_resource(self: &Self, key: &ResourceKey, theme: Option<&ThemeVariant>) -> Option<ResourceValue>
```

Tries to find a resource within the theme: the compact resources are
checked first when the density style is compact.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L333)

<a id="function-as_style"></a>

### as_style

```rust
fn as_style(self: &Self) -> Rc<dyn IStyle>
```

The theme as a style, for the style collections of applications and
elements (`application.styles().add(theme.as_style())`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L354)

<a id="function-as_resource_provider"></a>

### as_resource_provider

```rust
fn as_resource_provider(self: &Self) -> Rc<dyn IResourceProvider>
```

The theme as a resource provider.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Themes.MacOS/macos_theme.rs#L359)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<MacOSTheme>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
