TheSwamp

Code Red => .NET => Topic started by: It's Alive! on October 16, 2022, 06:44:17 AM

Title: .Net palettes and dark theme
Post by: It's Alive! on October 16, 2022, 06:44:17 AM
Are .NET palettes themed out of the box or do you have to add some magic?
this one is in MFC, total pain  :crazy2:

Title: Re: .Net palettes and dark theme
Post by: It's Alive! on October 16, 2022, 06:45:07 AM
in light mode
Title: Re: .Net palettes and dark theme
Post by: huiz on October 17, 2022, 04:29:26 AM
As far as I know there is no auto theming. You have to create two themes yourself (basically 2 AppStyles) which you switch on the COLORTHEME variable change.


But... there are two dark themes needed when you want to mimic the current AutoCAD colors, the first dark theme was changed a bit somewhere around AutoCAD 2019? or 2020?


And designing dark themes in WPF is quite a job. You have to write all ControlTemplates because the default MouseOver colors are not the same colors as used in AutoCAD. Also you need two sets of icons when they looks ugly with a dark or light background.


For what it's worth, our company only uses the light theme design only and I never heard a user ask for a dark theme.
Title: Re: .Net palettes and dark theme
Post by: It's Alive! on October 17, 2022, 05:31:23 AM
I was wondering about WPF and setting control colors
.NET has Autodesk.AutoCAD.Internal.ActiveThemeColor and ThemeEngine, I haven’t tried them yet


ARX has a theme manager i.e.

CAdUiThemeManager* pThemeManager = AdUiGetThemeManager();
CAdUiTheme* pTheme = pThemeManager->GetTheme(L"PropertyPalette");

Has an IsDark method, and you can grab the BKColor or TxtColor;
Some of the Autodesk CAdUi MFC controls have a SetTheme method,  but I’m still trying to figure it out lol

It’s better to look good, than to work good, right?
Title: Re: .Net palettes and dark theme
Post by: huiz on October 17, 2022, 06:02:39 AM
The ActiveThemeColor and the ThemeEngine are of no use, afaik. Probably you can find a PaletteBackground color but that's all. No methods to update buttons, controls, images or another UI element.


So, to support light and dark mode you still have to create two style XAML files and switch between them when the COLORTHEME var is changing.
Title: Re: .Net palettes and dark theme
Post by: kdub_nz on October 17, 2022, 04:26:35 PM
<< . . . >>

It’s better to look good, than to work good, right?

That's what she said :)
Title: Re: .Net palettes and dark theme
Post by: It's Alive! on October 17, 2022, 05:51:53 PM
<< . . . >>

It’s better to look good, than to work good, right?

That's what she said :)

LOL!  :lol:
Borrowed from Billy Crystal, it’s better to look good, than to feel good..
Title: Re: .Net palettes and dark theme
Post by: Atook on December 12, 2022, 01:47:06 PM
A little late, but we're using themes and mahapps.metro (https://mahapps.com/docs/guides/quick-start) w/ WPF

Looks OK. We didn't bother hooking it up to a listener, it just checks the Application.GetSystemVariable("COLORTHEME")

I kept our property grid in the shot too. There's a syncfusion one that looks good, but can't accept multiple items like the MS one does, so we're stuck with white now.
Title: Re: .Net palettes and dark theme
Post by: It's Alive! on December 12, 2022, 05:38:47 PM
Looks really good!
All of the dialogs launched from my palette aren’t themed, I guess we’ll be living with dual themes for a while.
There was an update for MFC a while back, CMFC, I need to explore those controls a bit more.