Jump to content
ivancx

Problem with Form/Window Caption on HIGH DPI, Delphi 10.3 and VCLStyles SKIN

Recommended Posts

New Delphi 10.3 project Applicaton - Manifest - Enable Runtime Themes, DPI Awareness Per Monitor v2 (so default)

 

procedure TForm24.FormCreate(Sender: TObject);
      var Style    : TStyleManager.TStyleServicesHandle;
begin
  self.font := screen.iconfont;
  self.PixelsPerInch := screen.PixelsPerInch;
  style:=TStyleManager.LoadFromFile(extractfilepath(paramstr(0))+'Dark Outlet Media.vsf');
  tstylemanager.SetStyle(style);
end;
 

New Delphi 10.3 project Applicaton - Manifest - Enable Runtime Themes, DPI Awareness Per Monitor v2 (so default)

Project uses
Vcl.Styles,
Vcl.Styles.Hooks,
Vcl.Styles.Utils.Forms,
Vcl.Styles.Utils.StdCtrls,
Vcl.Styles.Utils.ComCtrls,
Vcl.Styles.Utils.ScreenTips,
Vcl.Styles.Utils.SysControls,
Vcl.Styles.Utils.SysStyleHook,
Vcl.Styles.Utils.Shadow,
Vcl.Styles.FormStyleHooks

MainForm has

procedure TForm24.FormCreate(Sender: TObject);
      var Style    : TStyleManager.TStyleServicesHandle;
begin
  self.font := screen.iconfont;
  self.PixelsPerInch := screen.PixelsPerInch;
  style:=TStyleManager.LoadFromFile(extractfilepath(paramstr(0))+'Dark Outlet Media.vsf');
  tstylemanager.SetStyle(style);
end;

First if we run this app on HIGH DPI we get:

Look at the caption

 

Look at the caption - form caption is not visible at all - font size is too big and overloads caption area.

If we add following code at the FormCreate then the main app and all other captions look weard

 

StyleDPIAwareness := TStyleDPIAwareness.Create(Self);
StyleDPIAwareness.Parent := Self;

 

 

New Delphi 10.3 project Applicaton - Manifest - Enable Runtime Themes, DPI Awareness Per Monitor v2 (so default)

Project uses
Vcl.Styles,
Vcl.Styles.Hooks,
Vcl.Styles.Utils.Forms,
Vcl.Styles.Utils.StdCtrls,
Vcl.Styles.Utils.ComCtrls,
Vcl.Styles.Utils.ScreenTips,
Vcl.Styles.Utils.SysControls,
Vcl.Styles.Utils.SysStyleHook,
Vcl.Styles.Utils.Shadow,
Vcl.Styles.FormStyleHooks

MainForm has

procedure TForm24.FormCreate(Sender: TObject);
      var Style    : TStyleManager.TStyleServicesHandle;
begin
  self.font := screen.iconfont;
  self.PixelsPerInch := screen.PixelsPerInch;
  style:=TStyleManager.LoadFromFile(extractfilepath(paramstr(0))+'Dark Outlet Media.vsf');
  tstylemanager.SetStyle(style);
end;

First if we run this app on HIGH DPI we get:

Look at the caption

Look at the caption - form caption is not visible at all - font size is too big and overloads caption area.

If we add following code at the FormCreate then the main app and all other captions look weard

StyleDPIAwareness := TStyleDPIAwareness.Create(Self);
StyleDPIAwareness.Parent := Self;

enter image description here

TitleBar on Form Caption heigth is too big, and font is fisible, but I think too big too.

First question is I couldnt find a way to set window/form/caption font size, font weight and even font family name. We can set default font for Form, for all controls on form, but not form caption.

Also is there a way to decrease increasing height of the form caption in high dpi - so it is not as big as it is now.

This works fine in Delphi 10.2 with VCLStyles. Doesnt work with Delphi 10.3 with or without VCLStyles.

Share this post


Link to post
18 hours ago, GPRSNerd said:

Known problem with Rio 10.3.

There are several unfixed bugreports at Embarcadero.

If got link to Bugreport, would be more than willing to vote.

 

-Tee-

Share this post


Link to post

You can try our StyleControls VCL. 

 

It includes TscStyledForm component - it solve all problems with VCL Style for current form on High-DPI systems + you can add buttons and tabs in caption area.

Also it has TscStyleManager component (one for application) to solve all problems with styled menus and common dialogs.

For scaled messages you can use our scdialogs unit with scMessageDlg method and more. 

 

http://www.almdev.com

 

 

scds_hd1.png

apppager5.png

scaledmessage.png

Edited by Almediadev Support
  • Like 3

Share this post


Link to post
On 4/9/2019 at 7:57 AM, Tommi Prami said:

If got link to Bugreport, would be more than willing to vote.

 

-Tee-

Here's one of many:

 

https://quality.embarcadero.com/browse/RSP-22230

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×