Recent

Author Topic: ThemeServices.OnThemeChange is not fired on light/dark theme toggling  (Read 2588 times)

PascalDragon

  • Hero Member
  • *****
  • Posts: 6321
  • Compiler Developer
Re: ThemeServices.OnThemeChange is not fired on light/dark theme toggling
« Reply #15 on: January 20, 2026, 09:40:32 pm »
Official method is to track the color change:
https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/ui/apply-windows-themes

I'm negatively impressed... not by you, sgj, but what Microsoft considers as official solution. “If some specific color is considered dark then assume dark mode” 🤦‍♀️ Wow, just wow... 🙄

440bx

  • Hero Member
  • *****
  • Posts: 6088
Re: ThemeServices.OnThemeChange is not fired on light/dark theme toggling
« Reply #16 on: January 20, 2026, 10:40:32 pm »
“If some specific color is considered dark then assume dark mode”
Can you provide the url where MS made that statement ?... thanks.

PS: I don't doubt what you're saying, I was just interested in checking out the page, see what other "insights" they throw at the reader.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

PascalDragon

  • Hero Member
  • *****
  • Posts: 6321
  • Compiler Developer
Re: ThemeServices.OnThemeChange is not fired on light/dark theme toggling
« Reply #17 on: January 20, 2026, 10:57:13 pm »
“If some specific color is considered dark then assume dark mode”
Can you provide the url where MS made that statement ?... thanks.

They don't make that statement per se, but their whole code example for the section “Know when Dark mode is enabled” can be summarized with that statement.

440bx

  • Hero Member
  • *****
  • Posts: 6088
Re: ThemeServices.OnThemeChange is not fired on light/dark theme toggling
« Reply #18 on: January 21, 2026, 12:16:35 am »
They don't make that statement per se, but their whole code example for the section “Know when Dark mode is enabled” can be summarized with that statement.
Thanks PascalDragon.  That explains why I couldn't find it.
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018