You've already forked lazarus-ccr
jvcllaz: Implement lcl scaling for TJvRollOut. Adapt demo project.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7287 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -226,6 +226,17 @@ type
|
||||
property OnCollapse: TNotifyEvent read FOnCollapse write FOnCollapse;
|
||||
property OnExpand: TNotifyEvent read FOnExpand write FOnExpand;
|
||||
|
||||
{ LCL scaling }
|
||||
protected
|
||||
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
|
||||
const AXProportion, AYProportion: Double); override;
|
||||
public
|
||||
{$IF LCL_FullVersion >= 2010000}
|
||||
procedure FixDesignFontsPPI(const ADesignTimePPI: Integer); override;
|
||||
{$IFEND}
|
||||
procedure ScaleFontsPPI({$IF LCL_FullVersion >= 1080100}const AToPPI: Integer;{$IFEND}
|
||||
const AProportion: Double); override;
|
||||
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
@ -1610,6 +1621,40 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{ LCL scaling }
|
||||
|
||||
procedure TJvCustomRollOut.DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
|
||||
const AXProportion, AYProportion: Double);
|
||||
begin
|
||||
inherited;
|
||||
if AMode in [lapAutoAdjustWithoutHorizontalScrolling, lapAutoAdjustForDPI] then
|
||||
begin
|
||||
FButtonHeight := round(FButtonHeight * AYProportion);
|
||||
FChildOffset := round(FChildOffset * AXProportion);
|
||||
FCWidth := round(FCWidth * AXProportion);
|
||||
FCHeight := round(FCHeight * AYProportion);
|
||||
FAWidth := round(FAWidth * AXProportion);
|
||||
FAHeight := round(FAHeight * AYProportion);
|
||||
end;
|
||||
end;
|
||||
|
||||
{$IF LCL_FullVersion >= 2010000}
|
||||
procedure TJvCustomRollOut.FixDesignFontsPPI(const ADesignTimePPI: Integer);
|
||||
begin
|
||||
inherited;
|
||||
DoFixDesignFontPPI(FButtonFont, ADesignTimePPI);
|
||||
end;
|
||||
{$IFEND}
|
||||
|
||||
procedure TJvCustomRollOut.ScaleFontsPPI(
|
||||
{$IF LCL_FullVersion >= 1080100}const AToPPI: Integer;{$IFEND}
|
||||
const AProportion: Double);
|
||||
begin
|
||||
inherited;
|
||||
DoScaleFontPPI(FButtonFont, AToPPI, AProportion);
|
||||
end;
|
||||
|
||||
|
||||
//=== { TJvRollOutAction } ===================================================
|
||||
|
||||
destructor TJvRollOutAction.Destroy;
|
||||
|
Reference in New Issue
Block a user