You've already forked lazarus-ccr
jvcllaz: Fix high-dpi font scaling in JvTimeFrame components.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7125 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -72,12 +72,11 @@ object MainForm: TMainForm
|
|||||||
FancyRowHdrAttr.Hr2400 = False
|
FancyRowHdrAttr.Hr2400 = False
|
||||||
FancyRowHdrAttr.MinorFont.Color = clWindowText
|
FancyRowHdrAttr.MinorFont.Color = clWindowText
|
||||||
FancyRowHdrAttr.MajorFont.Color = clWindowText
|
FancyRowHdrAttr.MajorFont.Color = clWindowText
|
||||||
FancyRowHdrAttr.MajorFont.Height = -21
|
FancyRowHdrAttr.MajorFont.Height = -18
|
||||||
FancyRowHdrAttr.TickColor = clSilver
|
FancyRowHdrAttr.TickColor = clSilver
|
||||||
SelFancyRowHdrAttr.Hr2400 = True
|
SelFancyRowHdrAttr.Hr2400 = True
|
||||||
SelFancyRowHdrAttr.MinorFont.Color = clBlack
|
SelFancyRowHdrAttr.MinorFont.Color = clBlack
|
||||||
SelFancyRowHdrAttr.MajorFont.Color = clBlack
|
SelFancyRowHdrAttr.MajorFont.Color = clBlack
|
||||||
SelFancyRowHdrAttr.MajorFont.Height = -21
|
|
||||||
SelFancyRowHdrAttr.TickColor = clSilver
|
SelFancyRowHdrAttr.TickColor = clSilver
|
||||||
GridLineColor = clSilver
|
GridLineColor = clSilver
|
||||||
PrimeTime.StartTime = 0.333333333333333
|
PrimeTime.StartTime = 0.333333333333333
|
||||||
|
@ -63,7 +63,6 @@ uses
|
|||||||
JvTFManager, JvTFSparseMatrix, JvTFUtils;
|
JvTFManager, JvTFSparseMatrix, JvTFUtils;
|
||||||
|
|
||||||
const
|
const
|
||||||
// AbsMinColWidth = 5;
|
|
||||||
SizingThreshold = 5;
|
SizingThreshold = 5;
|
||||||
gcUndef = -3;
|
gcUndef = -3;
|
||||||
gcGroupHdr = -2;
|
gcGroupHdr = -2;
|
||||||
@ -3552,13 +3551,14 @@ var
|
|||||||
I: Integer;
|
I: Integer;
|
||||||
begin
|
begin
|
||||||
for I := 0 to Count - 1 do
|
for I := 0 to Count - 1 do
|
||||||
//Items[I].UpdateTitle;
|
|
||||||
Items[I].UpdateTitles;
|
Items[I].UpdateTitles;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//=== { TJvTFDaysFancyRowHdrAttr } ===========================================
|
//=== { TJvTFDaysFancyRowHdrAttr } ===========================================
|
||||||
|
|
||||||
constructor TJvTFDaysFancyRowHdrAttr.Create(AOwner: TJvTFDays);
|
constructor TJvTFDaysFancyRowHdrAttr.Create(AOwner: TJvTFDays);
|
||||||
|
var
|
||||||
|
h: Integer;
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
FGrid := AOwner;
|
FGrid := AOwner;
|
||||||
@ -3569,11 +3569,17 @@ begin
|
|||||||
FMinorFont := TFont.Create;
|
FMinorFont := TFont.Create;
|
||||||
if Assigned(FGrid) then
|
if Assigned(FGrid) then
|
||||||
FMinorFont.Assign(FGrid.Font);
|
FMinorFont.Assign(FGrid.Font);
|
||||||
|
FMinorFont.PixelsPerInch := 96;
|
||||||
|
|
||||||
FMajorFont := TFont.Create;
|
FMajorFont := TFont.Create;
|
||||||
if Assigned(FGrid) then
|
if Assigned(FGrid) then
|
||||||
FMajorFont.Assign(FGrid.Font);
|
FMajorFont.Assign(FGrid.Font);
|
||||||
FMajorFont.Size := FMajorFont.Size * 2;
|
if FMajorFont.Height = 0 then
|
||||||
|
begin
|
||||||
|
h := MulDiv(GetFontData(FMajorFont.Reference.Handle).Height, FMajorFont.PixelsPerInch, Screen.PixelsPerInch);
|
||||||
|
FMajorFont.Height := h*3 div 2;
|
||||||
|
end;
|
||||||
|
FMajorFont.PixelsPerInch := 96;
|
||||||
|
|
||||||
FMinorFont.OnChange := @FontChange;
|
FMinorFont.OnChange := @FontChange;
|
||||||
FMajorFont.OnChange := @FontChange;
|
FMajorFont.OnChange := @FontChange;
|
||||||
@ -3677,7 +3683,9 @@ begin
|
|||||||
begin
|
begin
|
||||||
FFont.Assign(FApptGrid.Font);
|
FFont.Assign(FApptGrid.Font);
|
||||||
FParentFont := True;
|
FParentFont := True;
|
||||||
end;
|
end else
|
||||||
|
FParentFont := False;
|
||||||
|
FFont.PixelsPerInch := 96;
|
||||||
FFont.OnChange := @FontChange;
|
FFont.OnChange := @FontChange;
|
||||||
|
|
||||||
FColor := clBtnFace;
|
FColor := clBtnFace;
|
||||||
@ -3919,6 +3927,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
FParentFont := False;
|
FParentFont := False;
|
||||||
|
FFont.PixelsPerInch := 96;
|
||||||
|
|
||||||
FFont.OnChange := @FontChange;
|
FFont.OnChange := @FontChange;
|
||||||
|
|
||||||
@ -4165,33 +4174,25 @@ begin
|
|||||||
ControlStyle := ControlStyle +
|
ControlStyle := ControlStyle +
|
||||||
[csOpaque, csCaptureMouse, csClickEvents, csDoubleClicks];
|
[csOpaque, csCaptureMouse, csClickEvents, csDoubleClicks];
|
||||||
|
|
||||||
(*
|
|
||||||
with GetControlClassDefaultSize do
|
|
||||||
SetInitialBounds(0, 0, CX, CY);
|
|
||||||
*)
|
|
||||||
{
|
|
||||||
Height := 300;
|
|
||||||
Width := 400;
|
|
||||||
}
|
|
||||||
|
|
||||||
FSaveFocCol := -1;
|
FSaveFocCol := -1;
|
||||||
|
|
||||||
//set property defaults
|
//set property defaults
|
||||||
// FBorderStyle := bsSingle;
|
// FBorderStyle := bsSingle;
|
||||||
FColHdrHeight := Scale96ToFont(DEFAULT_COL_HDR_HEIGHT);
|
FColHdrHeight := Scale96ToFont(DEFAULT_COL_HDR_HEIGHT);
|
||||||
FGroupHdrHeight := Scale96ToFont(DEFAULT_GROUP_HDR_HEIGHT);
|
FGroupHdrHeight := Scale96ToFont(DEFAULT_GROUP_HDR_HEIGHT);
|
||||||
|
FDefColWidth := Scale96ToFont(DEFAULT_DEF_COL_WIDTH);
|
||||||
|
FMinColWidth := Scale96ToFont(DEFAULT_MIN_COL_WIDTH);
|
||||||
|
FMinRowHeight := Scale96ToFont(DEFAULT_MIN_ROW_HEIGHT);
|
||||||
FRowHdrWidth := Scale96ToFont(DEFAULT_ROW_HDR_WIDTH);
|
FRowHdrWidth := Scale96ToFont(DEFAULT_ROW_HDR_WIDTH);
|
||||||
FRowHeight := Scale96ToFont(DEFAULT_ROW_HEIGHT);
|
FRowHeight := Scale96ToFont(DEFAULT_ROW_HEIGHT);
|
||||||
|
|
||||||
FGranularity := DEFAULT_GRANULARITY;
|
FGranularity := DEFAULT_GRANULARITY;
|
||||||
FTopRow := 0;
|
FTopRow := 0;
|
||||||
FFocusedRow := -1;
|
FFocusedRow := -1;
|
||||||
FMinColWidth := Scale96ToFont(DEFAULT_MIN_COL_WIDTH);
|
|
||||||
FLeftCol := -1;
|
FLeftCol := -1;
|
||||||
FFocusedCol := -1;
|
FFocusedCol := -1;
|
||||||
FDefColWidth := Scale96ToFont(DEFAULT_DEF_COL_WIDTH);
|
|
||||||
FVisibleScrollBars := [];
|
FVisibleScrollBars := [];
|
||||||
FAutoSizeCols := True;
|
FAutoSizeCols := True;
|
||||||
FMinRowHeight := Scale96ToFont(DEFAULT_MIN_ROW_HEIGHT);
|
|
||||||
ParentColor := False;
|
ParentColor := False;
|
||||||
Color := clSilver;
|
Color := clSilver;
|
||||||
FOptions := [agoSizeCols, agoSizeRows, agoSizeColHdr, agoSizeRowHdr,
|
FOptions := [agoSizeCols, agoSizeRows, agoSizeColHdr, agoSizeRowHdr,
|
||||||
@ -4247,7 +4248,7 @@ begin
|
|||||||
with FSelHdrAttr do
|
with FSelHdrAttr do
|
||||||
begin
|
begin
|
||||||
Color := clBtnFace;
|
Color := clBtnFace;
|
||||||
Font.Color := clBlack;
|
Font.Color := clWindowText;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FGroupHdrAttr := TJvTFDaysHdrAttr.Create(Self);
|
FGroupHdrAttr := TJvTFDaysHdrAttr.Create(Self);
|
||||||
|
@ -3456,6 +3456,7 @@ begin
|
|||||||
|
|
||||||
FFont := TFont.Create;
|
FFont := TFont.Create;
|
||||||
FFont.Color := clWindowText;
|
FFont.Color := clWindowText;
|
||||||
|
FFont.PixelsPerInch := 96;
|
||||||
FFont.OnChange := @FontChange;
|
FFont.OnChange := @FontChange;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3939,6 +3940,7 @@ begin
|
|||||||
inherited Create;
|
inherited Create;
|
||||||
|
|
||||||
FFont := TFont.Create;
|
FFont := TFont.Create;
|
||||||
|
FFont.PixelsPerInch := 96;
|
||||||
FFont.OnChange := @FontChange;
|
FFont.OnChange := @FontChange;
|
||||||
FAlignH := taLeftJustify;
|
FAlignH := taLeftJustify;
|
||||||
FAlignV := vaCenter;
|
FAlignV := vaCenter;
|
||||||
|
Reference in New Issue
Block a user