Tagged: scaling
- This topic has 12 replies, 2 voices, and was last updated 4 years, 1 month ago by
Support.
-
AuthorPosts
-
September 14, 2021 at 2:32 pm #70333
P.S. Using sAlphahints, rather than native hints, fixes the hint size issue. So best not to use the manifest.
September 16, 2021 at 5:06 pm #70342Hello, Kevin!
Which RAD Studio version do you use?September 18, 2021 at 6:08 am #70347I’m using XE3.
September 19, 2021 at 5:01 pm #70350Thanks for the info. XE3 have not good support of scaling, so, maybe your solution is the best for this cause.
September 20, 2021 at 5:58 am #70352> XE3 have not good support of scaling
Yes, however I’m loathe to spend several thousand dollars on the latest version of Delphi.
For non-alphacontrols apps, the DPI-aware manifest option works fine for scaling. One simply sets form scaling to true, and be sure to use truetype fonts. Some manual adjustments still need to be made to listbox itemheights and grid rowheights.
But alphacontrols works fine too, using sAlphahints rather than native hints.
September 20, 2021 at 3:34 pm #70353Is there a way to change the background color of alphahints to white – or whatever color the system is using – rather than yellow?
September 25, 2021 at 8:02 pm #70355Yes, it’s possible, I will prepare an example code soon.
September 28, 2021 at 10:35 am #70362Try to use this code in the TsSkinManager.OnActivate and OnAfterChange events:
begin if sSkinManager1.SkinCommonInfo.Sections[ssHint] >= 0 then with sSkinManager1.gd[sSkinManager1.SkinCommonInfo.Sections[ssHint]] do begin BorderIndex := -1; // Do not use predefined image if exists BorderWidth := 1; BorderRadius := 2; Props[0].Color := clYellow; Props[0].BorderColor := clBlue; Props[0].FontColor.Color := clRed; end; end;required:
uses sStyleSimply;September 28, 2021 at 12:38 pm #70363Sadly, this doesn’t work when I tried it. This is the code I used to test it:
unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, acAlphaHints, sSkinManager; type TForm1 = class(TForm) Button1: TButton; sSkinManager1: TsSkinManager; sAlphaHints1: TsAlphaHints; procedure sSkinManager1Activate(Sender: TObject); procedure sSkinManager1AfterChange(Sender: TObject); private { Private declarations } procedure SetHintColor(HintColor : TColor); public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} uses sStyleSimply; const // NewHintColor = clWhite; NewHintColor = clGreen; procedure TForm1.SetHintColor(HintColor : TColor); begin if sSkinManager1.SkinCommonInfo.Sections[ssHint] >= 0 then with sSkinManager1.gd[sSkinManager1.SkinCommonInfo.Sections[ssHint]] do begin BorderIndex := -1; // Do not use predefined image if exists BorderWidth := 1; BorderRadius := 2; Props[0].Color := HintColor; Props[0].BorderColor := clBlue; Props[0].FontColor.Color := clRed; end; end; procedure TForm1.sSkinManager1Activate(Sender: TObject); begin SetHintColor(NewHintColor); end; procedure TForm1.sSkinManager1AfterChange(Sender: TObject); begin SetHintColor(NewHintColor); end; end.September 28, 2021 at 1:19 pm #70364Update: setting sAlphaHints1.UseSkinData to true will display the modified color, but only the first time the hint is shown. Thereafter the hint is completely transparent, with no visible text.
January 9, 2022 at 4:30 am #70700I ended up solving my scaling issues, which were complex.
The problem isn’t with Alpha controls / skin manager.
With XE3 I have to manually include a manifest file which specifies DPI-Aware. This takes care of the hint scaling.
The other scaling issues were caused by other issues.
For reference, in case others have issues with font size, always check that the form scaiing is set to false, and also check the forms “ParentFont” setting, and whether there are any other manual font size settings in the code.
January 12, 2022 at 7:35 am #70706Hello, Kevin! Thank you for information.
-
AuthorPosts
- You must be logged in to reply to this topic.