tvplanit: Use some margin when drawing the day view event icons.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4847 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-06-27 23:00:17 +00:00
parent 5bbb50a408
commit cf5e6362ef

View File

@ -75,11 +75,9 @@ type
OldFont: TFont; OldFont: TFont;
protected protected
function BuildEventString(AEvent: TVpEvent; function BuildEventString(AEvent: TVpEvent; const AEventRect, AIconRect: TRect): String;
const AEventRect, AIconRect: TRect): String;
procedure CalcRowHeadRect(out ARect: TRect); procedure CalcRowHeadRect(out ARect: TRect);
function CountOverlappingEvents(Event: TVpEvent; function CountOverlappingEvents(Event: TVpEvent; const EArray: TVpDvEventArray): Integer;
const EArray: TVpDvEventArray): Integer;
procedure CreateBitmaps; procedure CreateBitmaps;
function DetermineIconRect(AEventRect: TRect): TRect; function DetermineIconRect(AEventRect: TRect): TRect;
function GetMaxOLEvents(Event: TVpEvent; const EArray: TVpDvEventArray): Integer; function GetMaxOLEvents(Event: TVpEvent; const EArray: TVpDvEventArray): Integer;
@ -124,6 +122,9 @@ uses
StrUtils, StrUtils,
VpCanvasUtils, VpMisc; VpCanvasUtils, VpMisc;
const
ICON_MARGIN = 4;
type type
TVpDayViewOpener = class(TVpDayView); TVpDayViewOpener = class(TVpDayView);
@ -223,14 +224,14 @@ begin
Result.Left := AEventRect.Left; Result.Left := AEventRect.Left;
Result.Top := AEventRect.Top; Result.Top := AEventRect.Top;
Result.Bottom := AEventRect.Bottom; Result.Bottom := AEventRect.Bottom;
Result.Right := AEventRect.Left + AlarmW + RecurringW + CategoryW + CustomW + 2; Result.Right := AEventRect.Left + AlarmW + RecurringW + CategoryW + CustomW + ICON_MARGIN + 2;
MaxHeight := AlarmH; MaxHeight := AlarmH + ICON_MARGIN;
if RecurringH > MaxHeight then if RecurringH + ICON_MARGIN > MaxHeight then
MaxHeight := dvBmpRecurring.Height; MaxHeight := dvBmpRecurring.Height;
if CategoryH > MaxHeight then if CategoryH + ICON_MARGIN > MaxHeight then
MaxHeight := dvBmpCategory.Height; MaxHeight := dvBmpCategory.Height;
if CustomH > MaxHeight then if CustomH + ICON_MARGIN > MaxHeight then
MaxHeight := dvBmpCustom.Height; MaxHeight := dvBmpCustom.Height;
if MaxHeight > AEventRect.Bottom - AEventRect.Top then if MaxHeight > AEventRect.Bottom - AEventRect.Top then
MaxHeight := AEventRect.Bottom - AEventRect.Top; MaxHeight := AEventRect.Bottom - AEventRect.Top;
@ -1032,7 +1033,7 @@ var
begin begin
bmp.Transparent := True; bmp.Transparent := True;
R := Rect(0, 0, w, h); R := Rect(0, 0, w, h);
OffsetRect(R, AIconRect.Left + 1, AIconRect.Top + 1); OffsetRect(R, AIconRect.Left + ICON_MARGIN, AIconRect.Top + ICON_MARGIN);
RenderCanvas.StretchDraw(R, bmp); RenderCanvas.StretchDraw(R, bmp);
{ {
RenderCanvas.CopyRect( // wp: was FDayview.Canvas -- does not look correct... RenderCanvas.CopyRect( // wp: was FDayview.Canvas -- does not look correct...
@ -1042,7 +1043,7 @@ var
); );
} }
if IncDrawPos then if IncDrawPos then
inc(DrawPos, w); inc(DrawPos, w + ICON_MARGIN);
end; end;
end; end;