You've already forked lazarus-ccr
CalLite: Enforce redrawing of control when font changes.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6957 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -268,6 +268,7 @@ type
|
||||
const AXProportion, AYProportion: Double); override;
|
||||
{$endif}
|
||||
procedure DblClick; override;
|
||||
procedure FontChanged(Sender: TObject); override;
|
||||
class function GetControlClassDefaultSize: TSize; override;
|
||||
procedure InternalClick;
|
||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||
@ -754,6 +755,7 @@ begin
|
||||
if not Assigned(FCanvas) then Exit;
|
||||
DecodeDate(FOwner.FDate, FThisYear, FThisMonth, FThisDay);
|
||||
CalcSettings;
|
||||
FCanvas.Font.Assign(FOwner.Font);
|
||||
DrawBackground;
|
||||
DrawTopRow;
|
||||
DrawDayLabels;
|
||||
@ -905,7 +907,7 @@ begin
|
||||
begin
|
||||
FCanvas.Font.Color := FOwner.Colors.HolidayColor;
|
||||
if coBoldHolidays in FOwner.Options then
|
||||
FCanvas.Font.Style := [fsBold];
|
||||
FCanvas.Font.Style := FCanvas.Font.Style + [fsBold];
|
||||
end else
|
||||
{ Special case: override weekend }
|
||||
if (coShowWeekend in FOwner.Options) and
|
||||
@ -913,7 +915,7 @@ begin
|
||||
begin
|
||||
FCanvas.Font.Color := FOwner.Colors.WeekendColor;
|
||||
if coBoldWeekend in FOwner.Options then
|
||||
FCanvas.Font.Style := [fsBold];
|
||||
FCanvas.Font.Style := FCanvas.Font.Style + [fsBold];
|
||||
end;
|
||||
end else
|
||||
begin
|
||||
@ -993,9 +995,9 @@ var
|
||||
begin
|
||||
FCanvas.Font.Color:= FOwner.Colors.TextColor;
|
||||
if (coBoldDayNames in FOwner.Options) then
|
||||
FCanvas.Font.Style := [fsBold]
|
||||
FCanvas.Font.Style := FCanvas.Font.Style + [fsBold]
|
||||
else
|
||||
FCanvas.Font.Style := [];
|
||||
FCanvas.Font.Style := FCanvas.Font.Style - [fsBold];
|
||||
map := Integer(FOwner.FStartingDayOfWeek);
|
||||
for c:= Low(TWeekNameArray) to High(TWeekNameArray) do
|
||||
begin
|
||||
@ -1037,8 +1039,8 @@ begin
|
||||
FCanvas.Font.Color:= FOwner.Colors.TextColor;
|
||||
|
||||
if coBoldToday in FOwner.Options then
|
||||
FCanvas.Font.Style := [fsBold] else
|
||||
FCanvas.Font.Style := [];
|
||||
FCanvas.Font.Style := FCanvas.Font.Style + [fsBold] else
|
||||
FCanvas.Font.Style := FCanvas.Font.Style - [fsBold];
|
||||
|
||||
s:= FOwner.GetDisplayText(dtToday);
|
||||
if pos('%s', s) = 0 then begin
|
||||
@ -1099,9 +1101,9 @@ begin
|
||||
if (FCanvas.Font.Color <> FOwner.Colors.TextColor) then
|
||||
FCanvas.Font.Color := FOwner.Colors.TextColor;
|
||||
if (coBoldTopRow in FOwner.Options) then
|
||||
FCanvas.Font.Style := [fsBold]
|
||||
FCanvas.Font.Style := FCanvas.Font.Style + [fsBold]
|
||||
else
|
||||
FCanvas.Font.Style := [];
|
||||
FCanvas.Font.Style := FCanvas.Font.Style - [fsBold];
|
||||
|
||||
case (FOwner.BiDiMode = bdLeftToRight) of
|
||||
False: begin
|
||||
@ -1590,6 +1592,12 @@ begin
|
||||
Invalidate;
|
||||
end;
|
||||
|
||||
procedure TCalendarLite.FontChanged(Sender: TObject);
|
||||
begin
|
||||
inherited;
|
||||
Draw;
|
||||
end;
|
||||
|
||||
class function TCalendarLite.GetControlClassDefaultSize: TSize;
|
||||
begin
|
||||
{$ifdef lcl_scaling}
|
||||
|
Reference in New Issue
Block a user