Author Topic: .Net palettes and dark theme  (Read 3297 times)

0 Members and 1 Guest are viewing this topic.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
.Net palettes and dark theme
« 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:


It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: .Net palettes and dark theme
« Reply #1 on: October 16, 2022, 06:45:07 AM »
in light mode

huiz

  • Swamp Rat
  • Posts: 913
  • Certified Prof C3D
Re: .Net palettes and dark theme
« Reply #2 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.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: .Net palettes and dark theme
« Reply #3 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?

huiz

  • Swamp Rat
  • Posts: 913
  • Certified Prof C3D
Re: .Net palettes and dark theme
« Reply #4 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.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2120
  • class keyThumper<T>:ILazy<T>
Re: .Net palettes and dark theme
« Reply #5 on: October 17, 2022, 04:26:35 PM »
<< . . . >>

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

That's what she said :)
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: .Net palettes and dark theme
« Reply #6 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..

Atook

  • Swamp Rat
  • Posts: 1027
  • AKA Tim
Re: .Net palettes and dark theme
« Reply #7 on: December 12, 2022, 01:47:06 PM »
A little late, but we're using themes and mahapps.metro 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.

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8659
  • AKA Daniel
Re: .Net palettes and dark theme
« Reply #8 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.