Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!
Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.
Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!
I'm not a daily Windows user, and Lazarus (at the moment) does not follow the Windows settings when set to Darkmode. Understandably, I have some applications where Windows users would like to see DarkMode, but the widgetset (LCL) does not support this at the time.
After a lot of searching, I did find a way that at least looks like it is darkmode - keep in mind that its pretty close but not perfect. This most likely only works with Windows 10 (I believe it even requires certain Windows 10 updats) and Windows 11. Tested with Win32 and Win64 binaries.
These are the steps (files attached - extract in project directory) to make your application start (!) in darkmode under Windows, when Windows is set to darkmode.
Note that changing dark/light mode while the application is running, is not working at the moment (suggestions/input most welcome).
To make it work fully, I've added this to my main forms "OnCreate" event - this fixes some minor details that for some reason are not done automatically:
procedure TForm1.FormCreate(Sender: TObject);
begin
...
if IsDarkModeAppearance then ApplyDarkStyle;
...
end;
The function "IsDarkModeAppearance" detects darkmode kind-a cross platform, this is the part needed for Windows:
function IsDarkModeAppearance:boolean;
const
KEYPATH = '\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize';
KEYNAME = 'AppsUseLightTheme';
var
LightKey: boolean;
Registry: TRegistry;
begin
Result := false;
Registry := TRegistry.Create;
try
Registry.RootKey := HKEY_CURRENT_USER;
if Registry.OpenKeyReadOnly(KEYPATH) then
begin
if Registry.ValueExists(KEYNAME) then
LightKey := Registry.ReadBool(KEYNAME)
else
LightKey := true;
end
else
LightKey := true;
Result := not LightKey
finally
Registry.Free;
end;
end;
Note: The modifications I made were done in "uDarkStyle.pas" (line 254):
// mod to make sure light mode works proper as well
// was: AppMode := TPreferredAppMode(pamDefault);
if ShouldAppsUseDarkMode then
AppMode := pamForceDark
else
AppMode := TPreferredAppMode(pamDefault);
What this does is make sure things work properly in light mode (pamDefault) and dark mode (pamForceDark). The latter makes sure the titlebar is dark as well.
Based on slightly modified excellent and extensive work by Alexander Koblov (Double Commander).
Ulvenhout.com My home town ... Ulvenhout in the Netherlands (Noord Brabant)
ViMediaManager ViMediaManager is a media manager for Mac OS X, allowing you to gather, store, and manage information, extra art, trailers and television tunes for your movie, television etc for use with for example XBMC.
Lazarus / FPC Lazarus / Free Pascal Compiler - A cross platform software development environment that show similarities with the good old Delphi.
Robots.txt Analyzer Very simple and effective tool for online checking of your robots.txt file without having to use Google Webmaster Tools.
AlternativeTo Great resource when you're looking for alternatives for an application that you'd like to use, but might not be available on your platform or the application you have is just not doing it right.
Links Page These and more of our favorite links can be found on the Links Page.
New Downloads
ConnectMeNow4-v4.0.18-macOS-x86-64.dmgDate: 2024-04-24 - Size: 3.5 MBVersion 4 of ConnectMeNow - A tool for more convenient mounting of network shares under macOS. This is the Intel version which works on Intel and Apple Silicon Macs.
ConnectMeNow4-v4.0.18-macOS-arm64.dmgDate: 2024-04-24 - Size: 3 MBVersion 4 of ConnectMeNow - A tool for more convenient mounting of network shares under macOS. This is the Apple Silicon version (not suitable for Intel).
MiniWOL2 MacOS (64 bits Apple Silicon)Date: 2023-08-01 - Size: 1.2 MBminiWol is a simple, but effective application to send Wake On LAN to network devices. This is the signed 64 bit MacOS ARM (Apple Silicon) version.
MovieScanner2-2.2.3-Windows-32bit-setup.exeDate: 2023-04-12 - Size: 18.6 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 32 bit Windows version.
MovieScanner2-2.2.2-Linux-GTK-64bits.tar.gzDate: 2023-04-11 - Size: 29.2 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 64 bit Linux version for GTK.
MovieScanner2-2.2.2-Linux-QT5-64bits.tar.gzDate: 2023-04-11 - Size: 29.1 MBA small application that uses FFProbe to scan your video files and logs these details in a small database. This is the 64 bit Linux version for QT5.
Downloads Page Find these and more Downloads on the Downloads Page, where you will also find articles references, operating system requirements and categories.
Amazon Ads
Support us by doing your shopping at Amazon.com, either click the link, or click one of the links below …
You can also sponsor us through these Amazon offerings:
Please consider disabling your ad blocker for our website.We rely on these ads to be able to run our website.You can of course support us in other ways (see Support Us on the left).