tvplanit: Allow to draw all-day events in the category color (CategoryInfo.UseForAllDayEvents).

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8394 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-08-16 19:58:12 +00:00
parent 6e9dd5576c
commit 0afcfc7a66
3 changed files with 29 additions and 13 deletions

View File

@ -308,6 +308,7 @@ var
AllDayWidth: Integer;
OldTop: LongInt;
txtDist: Integer;
cat: TVpCategoryInfo;
begin
// Initialize the rectangle to be used for all-day events
ADEventsRect := InitAllDayEventsRect;
@ -397,8 +398,16 @@ begin
AdEvRect.Left := AdEventsRect.Left + DayWidth * I + txtDist;
AdEvRect.Right := AdEventsRect.Left + DayWidth * (I + 1) - txtDist;
RenderCanvas.Brush.Color := ADEventAttrBkgColor;
RenderCanvas.Pen.Color := ADEventBorderColor;
cat := FDayView.Datastore.CategoryColorMap.GetCategory(Event.Category);
if cat.UseForAllDayEvents then
begin
RenderCanvas.Brush.Color := cat.BackgroundColor;
RenderCanvas.Pen.Color := cat.Color;
end else
begin
RenderCanvas.Brush.Color := ADEventAttrBkgColor;
RenderCanvas.Pen.Color := ADEventBorderColor;
end;
TPSRectangle(RenderCanvas, Angle, RenderIn,
ADEvRect.Left + txtDist,
ADEvRect.Top + txtDist,