mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-26 07:09:18 +02:00
lcl: headercontrol: High-DPI. Issue #31429, patch by Anton Kavalenka
git-svn-id: trunk@54224 -
This commit is contained in:
parent
b64d6fc80e
commit
d6983d5300
@ -3874,6 +3874,8 @@ type
|
|||||||
X, Y: Integer); override;
|
X, Y: Integer); override;
|
||||||
procedure UpdateState;
|
procedure UpdateState;
|
||||||
class function GetControlClassDefaultSize: TSize; override;
|
class function GetControlClassDefaultSize: TSize; override;
|
||||||
|
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
|
||||||
|
const AXProportion, AYProportion: Double); override;
|
||||||
public
|
public
|
||||||
property SectionFromOriginalIndex[OriginalIndex: Integer]: THeaderSection read GetSectionFromOriginalIndex;
|
property SectionFromOriginalIndex[OriginalIndex: Integer]: THeaderSection read GetSectionFromOriginalIndex;
|
||||||
|
|
||||||
|
@ -417,6 +417,29 @@ begin
|
|||||||
ThemeServices.DrawText(Canvas, Details, Section.Text, ContentRect, AlignmentMap[Section.Alignment] or DT_VCENTER or DT_SINGLELINE, 0);
|
ThemeServices.DrawText(Canvas, Details, Section.Text, ContentRect, AlignmentMap[Section.Alignment] or DT_VCENTER or DT_SINGLELINE, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCustomHeaderControl.DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
|
||||||
|
const AXProportion, AYProportion: Double);
|
||||||
|
var
|
||||||
|
I: integer;
|
||||||
|
Sect: THeaderSection;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
|
||||||
|
if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then
|
||||||
|
begin
|
||||||
|
Sections.BeginUpdate;
|
||||||
|
try
|
||||||
|
for I := 0 to Sections.Count-1 do
|
||||||
|
begin
|
||||||
|
Sect := Sections.Items[I];
|
||||||
|
Sect.Width := Round(Sect.Width*AXProportion);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
Sections.EndUpdate;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomHeaderControl.ChangeScale(M, D: Integer);
|
procedure TCustomHeaderControl.ChangeScale(M, D: Integer);
|
||||||
var
|
var
|
||||||
I: integer;
|
I: integer;
|
||||||
|
Loading…
Reference in New Issue
Block a user