Custom Avalonia Themes developed by Devolutions
(Inspired by @MikeCodesDotNET's earlier draft)
This theme is currently based on Avalonia.Themes.Fluent, both as a fallback for any controls not covered yet and as starting point for our (somewhat simplified) style definitions targeting AppKit macOS look.
While we are prioritizing controls for Devolutions Remote Desktop Manager initially, the goal is to create a theme that helps all of the Avalonia community to bring a native look to their macOS apps.
- Installation
- Styled Controls
- ✅ Available in the current build
- 🚧 In progress
- Inactive window behaviour
- 🔮 Next on the road map ...
- ToolTip
Install the MacOS.Avalonia.Theme package via NuGet:
Install-Package MacOS.Avalonia.Theme
or .NET
dotnet add package MacOS.Avalonia.Theme
In your App.axaml, replace the existing theme (e.g. <FluentTheme />
or <SimpleTheme />
) with the macOS theme:
<Application ...>
<Application.Styles>
<StyleInclude Source="avares://MacOS.Avalonia.Theme/MacOSTheme.axaml" />
</Application.Styles>
</Application>
Notes | ||
---|---|---|
✅ | ||
![]() |
||
✅ | ||
![]() |
||
✅ | ||
![]() |
||
✅ | ||
![]() |
||
✅ | ||
![]() |
The editable field still has an issue, forcing the row to be slightly higher than the others | |
✅ | ||
![]() |
||
✅ | ||
![]() ![]() ![]() ![]() |
Use:
|
|
✅ | ||
![]() ![]() |
||
✅ | ||
See Menu, MenuFlyoutPresenter, ContextMenu | ||
✅ | ||
Default:![]() AllowAutoHide="False" :![]() |
Note that even with AllowAutoHide="True" the scrollbars won't completely hide. This is intentional, since scrolling events will not trigger a 'show' (only moving the pointer directly over the track area will) - so completely hiding would be confusing. Mousing over one of the track areas will make the thumb bar grow wider and darker and the track appears. To suppress this behaviour (e.g. on images) use Classes="MacOS_TransparentTrack" |
|
✅ | ||
See Menu, MenuFlyoutPresenter, ContextMenu | ||
✅ | ||
![]() |
Vertical tabs may still need some work | |
✅ | ||
![]() |
There appears to be no easy way for styling the caret thickness and margin | |
✅ | ||
![]() |
Use Classes="MacOS_Theme_AlternatingRowColor" to achieve striped background. (Cannot currently be rendered with rounded corners & breaks when default TreeViewItem height is altered (see comment in ThemeResources.axaml)) |
|