Yes, I see your reasoning there wp. But I wonder if its a chicken and egg situation ?
When the windows (.inc) sections of LCL was written, there was no 'theme' available. Nor could they look for the registry entry that indicates you have set the dark theme, it was not, then, defined.
I wonder if System Settings and Explorer look to the registry setting rather than ThemeServices and perhaps Microsoft think thats "job done" ?
I have code in my app that looks at GetRGBColorResolvingParent() color because I do need to manually set some colors, particularly in KControls. Works fine in Linux but under windows that function does not work because, presumably, Windows returns the desktop color ? and it has not changed. But checking the registry entry is easy -
{$ifdef WINDOWS} function WinDarkTheme : boolean;
var
RegValue : string='';
Registry : TRegistry;
begin
Registry := TRegistry.Create;
try
Registry.RootKey := HKEY_CURRENT_USER;
if Registry.OpenKeyReadOnly('\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize') then
exit(Registry.ReadInteger('AppsUseLightTheme') = 0)
else exit(false);
finally
Registry.Free;
end;
end; {$endif}
So, my thoughts are that LCL needs to do that during initialization and adjust its colors then. That
assumes Microsoft is content to have one dark theme switch and one dark theme.
Something I have noted is that the only thing uglier than a dark theme is a dark theme done badly, and that what I am doing ! :-)
Thanks wp.
Davo