You've already forked lazarus-ccr
spkToolbar: Fix appearance fonts not being changeable (undo part of r5073 - High-DPI code for fonts must be put into application, not in component).
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5345 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -31,7 +31,6 @@ type TSpkTabAppearance = class(TPersistent)
|
|||||||
// *** Gettery i settery ***
|
// *** Gettery i settery ***
|
||||||
|
|
||||||
procedure SetHeaderFont(const Value: TFont);
|
procedure SetHeaderFont(const Value: TFont);
|
||||||
function GetTabHeaderFont: TFont;
|
|
||||||
procedure SetBorderColor(const Value: TColor);
|
procedure SetBorderColor(const Value: TColor);
|
||||||
procedure SetGradientFromColor(const Value: TColor);
|
procedure SetGradientFromColor(const Value: TColor);
|
||||||
procedure SetGradientToColor(const Value: TColor);
|
procedure SetGradientToColor(const Value: TColor);
|
||||||
@ -47,7 +46,7 @@ type TSpkTabAppearance = class(TPersistent)
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Reset;
|
procedure Reset;
|
||||||
published
|
published
|
||||||
property TabHeaderFont : TFont read GetTabHeaderFont write SetHeaderFont;
|
property TabHeaderFont : TFont read FTabHeaderFont write SetHeaderFont;
|
||||||
property BorderColor : TColor read FBorderColor write SetBorderColor;
|
property BorderColor : TColor read FBorderColor write SetBorderColor;
|
||||||
property GradientFromColor : TColor read FGradientFromColor write SetGradientFromColor;
|
property GradientFromColor : TColor read FGradientFromColor write SetGradientFromColor;
|
||||||
property GradientToColor : TColor read FGradientToColor write SetGradientToColor;
|
property GradientToColor : TColor read FGradientToColor write SetGradientToColor;
|
||||||
@ -67,7 +66,6 @@ type TSpkPaneAppearance = class(TPersistent)
|
|||||||
FGradientType : TBackgroundKind;
|
FGradientType : TBackgroundKind;
|
||||||
|
|
||||||
procedure SetCaptionFont(const Value: TFont);
|
procedure SetCaptionFont(const Value: TFont);
|
||||||
function GetCaptionFont: TFont;
|
|
||||||
procedure SetBorderDarkColor(const Value: TColor);
|
procedure SetBorderDarkColor(const Value: TColor);
|
||||||
procedure SetBorderLightColor(const Value: TColor);
|
procedure SetBorderLightColor(const Value: TColor);
|
||||||
procedure SetGradientFromColor(const Value: TColor);
|
procedure SetGradientFromColor(const Value: TColor);
|
||||||
@ -82,7 +80,7 @@ type TSpkPaneAppearance = class(TPersistent)
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Reset;
|
procedure Reset;
|
||||||
published
|
published
|
||||||
property CaptionFont : TFont read GetCaptionFont write SetCaptionFont;
|
property CaptionFont : TFont read FCaptionFont write SetCaptionFont;
|
||||||
property BorderDarkColor : TColor read FBorderDarkColor write SetBorderDarkColor;
|
property BorderDarkColor : TColor read FBorderDarkColor write SetBorderDarkColor;
|
||||||
property BorderLightColor : TColor read FBorderLightColor write SetBorderLightColor;
|
property BorderLightColor : TColor read FBorderLightColor write SetBorderLightColor;
|
||||||
property GradientFromColor : TColor read FGradientFromColor write SetGradientFromColor;
|
property GradientFromColor : TColor read FGradientFromColor write SetGradientFromColor;
|
||||||
@ -126,7 +124,6 @@ type TSpkElementAppearance = class(TPersistent)
|
|||||||
procedure SetActiveInnerDarkColor(const Value: TColor);
|
procedure SetActiveInnerDarkColor(const Value: TColor);
|
||||||
procedure SetActiveInnerLightColor(const Value: TColor);
|
procedure SetActiveInnerLightColor(const Value: TColor);
|
||||||
procedure SetCaptionFont(const Value: TFont);
|
procedure SetCaptionFont(const Value: TFont);
|
||||||
function GetCaptionFont: TFont;
|
|
||||||
procedure SetHotTrackCaptionColor(const Value: TColor);
|
procedure SetHotTrackCaptionColor(const Value: TColor);
|
||||||
procedure SetHotTrackFrameColor(const Value: TColor);
|
procedure SetHotTrackFrameColor(const Value: TColor);
|
||||||
procedure SetHotTrackGradientFromColor(const Value: TColor);
|
procedure SetHotTrackGradientFromColor(const Value: TColor);
|
||||||
@ -149,7 +146,7 @@ type TSpkElementAppearance = class(TPersistent)
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Reset;
|
procedure Reset;
|
||||||
published
|
published
|
||||||
property CaptionFont : TFont read GetCaptionFont write SetCaptionFont;
|
property CaptionFont : TFont read FCaptionFont write SetCaptionFont;
|
||||||
property IdleFrameColor : TColor read FIdleFrameColor write SetIdleFrameColor;
|
property IdleFrameColor : TColor read FIdleFrameColor write SetIdleFrameColor;
|
||||||
property IdleGradientFromColor : TColor read FIdleGradientFromColor write SetIdleGradientFromColor;
|
property IdleGradientFromColor : TColor read FIdleGradientFromColor write SetIdleGradientFromColor;
|
||||||
property IdleGradientToColor : TColor read FIdleGradientToColor write SetIdleGradientToColor;
|
property IdleGradientToColor : TColor read FIdleGradientToColor write SetIdleGradientToColor;
|
||||||
@ -383,29 +380,12 @@ begin
|
|||||||
FDispatch.NotifyAppearanceChanged;
|
FDispatch.NotifyAppearanceChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSpkTabAppearance.GetTabHeaderFont: TFont;
|
|
||||||
var
|
|
||||||
ScaledFont: TFont;
|
|
||||||
begin
|
|
||||||
if DPI_AWARE then
|
|
||||||
begin
|
|
||||||
ScaledFont := TFont.Create;
|
|
||||||
ScaledFont.Assign(FTabHeaderFont);
|
|
||||||
//ScaledFont.Height := SpkScaleY(ScaledFont.Height, 96); // leave it to uscaledpi
|
|
||||||
Result := ScaledFont;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Result := FTabHeaderFont;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{ TSpkPaneAppearance }
|
{ TSpkPaneAppearance }
|
||||||
|
|
||||||
procedure TSpkPaneAppearance.Assign(Source: TPersistent);
|
procedure TSpkPaneAppearance.Assign(Source: TPersistent);
|
||||||
|
var
|
||||||
var SrcAppearance : TSpkPaneAppearance;
|
SrcAppearance : TSpkPaneAppearance;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if Source is TSpkPaneAppearance then
|
if Source is TSpkPaneAppearance then
|
||||||
begin
|
begin
|
||||||
@ -428,11 +408,8 @@ end;
|
|||||||
constructor TSpkPaneAppearance.Create(ADispatch: TSpkBaseAppearanceDispatch);
|
constructor TSpkPaneAppearance.Create(ADispatch: TSpkBaseAppearanceDispatch);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FDispatch:=ADispatch;
|
FDispatch:=ADispatch;
|
||||||
|
|
||||||
FCaptionFont:=TFont.Create;
|
FCaptionFont:=TFont.Create;
|
||||||
|
|
||||||
Reset;
|
Reset;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -598,22 +575,6 @@ begin
|
|||||||
FDispatch.NotifyAppearanceChanged;
|
FDispatch.NotifyAppearanceChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSpkPaneAppearance.GetCaptionFont: TFont;
|
|
||||||
var
|
|
||||||
ScaledFont: TFont;
|
|
||||||
begin
|
|
||||||
if DPI_AWARE then
|
|
||||||
begin
|
|
||||||
ScaledFont := TFont.Create;
|
|
||||||
ScaledFont.Assign(FCaptionFont);
|
|
||||||
//ScaledFont.Height := SpkScaleY(ScaledFont.Height, 96); // leave it to uscaledpi
|
|
||||||
Result := ScaledFont;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Result := FCaptionFont;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{ TSpkElementAppearance }
|
{ TSpkElementAppearance }
|
||||||
|
|
||||||
@ -974,21 +935,6 @@ begin
|
|||||||
FDispatch.NotifyAppearanceChanged;
|
FDispatch.NotifyAppearanceChanged;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSpkElementAppearance.GetCaptionFont: TFont;
|
|
||||||
var
|
|
||||||
ScaledFont: TFont;
|
|
||||||
begin
|
|
||||||
if DPI_AWARE then
|
|
||||||
begin
|
|
||||||
ScaledFont := TFont.Create;
|
|
||||||
ScaledFont.Assign(FCaptionFont);
|
|
||||||
//ScaledFont.Height := SpkScaleY(ScaledFont.Height, 96); // leave it to uscaledpi
|
|
||||||
Result := ScaledFont;
|
|
||||||
end
|
|
||||||
else
|
|
||||||
Result := FCaptionFont;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TSpkElementAppearance.SetHotTrackCaptionColor(
|
procedure TSpkElementAppearance.SetHotTrackCaptionColor(
|
||||||
const Value: TColor);
|
const Value: TColor);
|
||||||
begin
|
begin
|
||||||
|
Reference in New Issue
Block a user