Theming: Primarily for Bars and Windows

Bars for Avalonia Forum

Posted 11 days ago by Adrian Egger
Avatar

Hi!

I am currently working with your Bars and Docking components and really enjoy them!
Since these are rather new additions, I would like to inquire on your eagerness of implementing themeing for the Bars and Windows components.
I see that you already have something in place for your WPF components (https://www.actiprosoftware.com/docs/controls/wpf/themes/getting-started) along side the Theme Designer and was wondering if you intend to extend your Avalonia components with this functionality as well. 

In my intended use case, I would like to be able to also change the theme at runtime (there can be many instances of the same app and associated windows open...) so that a user can destinguish based on color, similarly to the VS Code extension Peacock.

Is something like that reasonable/possible to expect in the future and can it already be achieved with the existing release of you components?

Looking forward to your reply and keep up the great work!
kind regards
Adrian

Comments (3)

Posted 10 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Adrian,

That's great to hear you are enjoying our Avalonia products.  Our Avalonia theme system is evolved from our excellent WPF theme system, and we've tried to make a number of external and internal improvements along the way when we wrote the Avalonia version. 

One area we didn't finalize yet was how to allow for color palette customization.  Right now a single palette is used for all default brush generation.  Being able to customize the color palette passed to theme generator sessions would be handy for full-theme tinting capabilities and is on the TODO list.  We have a good start on what we want to do to add it.

That being said, in the current version we do allow you to inject a custom ThemeGenerator class where you can customize the value generated for any brush.  This documentation topic walks through how to do that kind of thing for any theme, and even how to add custom brushes.  So for instance you could easily override title bar brushes, container background brushes, etc.  Even with just that, you should have the ability to create a customized appearance on the fly at runtime.


Actipro Software Support

Posted 10 days ago by Adrian Egger
Avatar

Thank you for the quick reply!

Well, in that case, I will look forward to the next couple of releases.
In the meantime, I will experiment with Theme Generator.

kind regards

Answer - Posted 9 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Adrian,

We've completed our updates to allow for complete color palette customization.  Our included DefaultColorPaletteFactory implements logic to build a color palette.  It has properties to support customizing the midtone of each color ramp.  By altering the NeutralMidtoneColor property, you can effectively "tint" the entire application, either in subtle or more vivid way, depending on the color you choose.

In this example, we tint the application to purple.

<actipro:ModernTheme Includes="All">
	<actipro:ModernTheme.Definition>
		<generation:ThemeDefinition>
			<generation:ThemeDefinition.ColorPaletteFactory>
				<generation:DefaultColorPaletteFactory NeutralMidtoneColor="#716378" />
			</generation:ThemeDefinition.ColorPaletteFactory>
		</generation:ThemeDefinition>
	</actipro:ModernTheme.Definition>
</actipro:ModernTheme>

The tint will be more dramatic in dark theme variants.

Our Color Palette utility in the Sample Browser has also been updated to let you switch between several different example neutral tones.

All of these updates will be in v25.2.1, once it is released.  If you'd like an early preview build to test, please write our support address and mention this thread.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.