Difference between revisions of "Win32TitleStyler"

From Lazarus wiki
Jump to navigationJump to search
 
Line 16: Line 16:
 
      
 
      
 
* Parameter ADarkMode: set to True for dark title, set to False for default title (white on Windows 10).
 
* Parameter ADarkMode: set to True for dark title, set to False for default title (white on Windows 10).
* Parameter AForceApply: was needed for CudaText, you can always pass True here. With value False, CudaText cannot make the title dark - after restoring from the full-screen mode (Win10 resets dark style to white style).
+
* Parameter AForceApply: value True: component will apply the change harder, it will change the form size by 1 pixel up, then by 1 pixel down, to force the applying. With value False, CudaText cannot make the title dark - after restoring from the full-screen mode.

Latest revision as of 08:24, 4 June 2022

About

This is unit, it gives the procedure to make the form's title - dark, using Win32 API. It works on Windows 10 and 11+ (it doesn't do anything on older Windows, and it doesn't work on some older builds of Windows 10).

Download link on GitHub

Screenshot of CudaText with applied dark color. The TMainMenu color was changed by Win32MenuStyler.

cudatext-dark-title.png

Usage

 ApplyFormDarkTitle(AForm: TForm; ADarkMode: bool; AForceApply: bool);
  • Parameter ADarkMode: set to True for dark title, set to False for default title (white on Windows 10).
  • Parameter AForceApply: value True: component will apply the change harder, it will change the form size by 1 pixel up, then by 1 pixel down, to force the applying. With value False, CudaText cannot make the title dark - after restoring from the full-screen mode.