tvplanit: Some more fine-tuning of pixels when painting day and week views.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4895 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-07-02 13:07:46 +00:00
parent dd215650bc
commit b25bcf4516
2 changed files with 11 additions and 23 deletions

View File

@ -657,6 +657,8 @@ begin
else
if FDayView.DrawingStyle = ds3d then begin
dec(R.Bottom);
if Col = FDayView.NumDays - 1 then
dec(R.Right, 4);
R := TPSRotateRectangle(Angle, RenderIn, R);
DrawBevelRect(RenderCanvas, R, BevelHighlight, BevelDarkShadow);
end;
@ -1352,7 +1354,7 @@ end;
procedure TVpDayViewPainter.CalcRowHeadRect(out ARect: TRect);
begin
ARect := Rect(
RealLeft + 1,
RealLeft, // + 1,
ADEventsRect.Bottom, // + 1,
RealLeft + 2 + RealRowHeadWidth,
RealBottom //- 1
@ -1709,7 +1711,7 @@ begin
{ added because level 0 events were one pixel too far to the right }
else
AEventRect.Left := AEventRect.Left - 1;
AEventRect.Right := AEventRect.Left + eventWidth - FDayView.GutterWidth;
AEventRect.Right := AEventRect.Left + eventWidth + 1; //- FDayView.GutterWidth + 1;
end;
{ remove the date portion from the start and end times }

View File

@ -13,7 +13,7 @@ type
private
FWeekView: TVpWeekView;
// local parameters of the old TVpWeekView method
HeadRect: TRect;
// HeadRect: TRect;
DayRectHeight: Integer;
// StrLn: Integer;
StartDate: TDateTime;
@ -518,6 +518,7 @@ end;
procedure TVpWeekViewPainter.DrawHeader;
var
HeadRect: TRect;
HeadTextRect: TRect;
HeadStr: string;
HeadStrLen : Integer;
@ -527,26 +528,16 @@ begin
RenderCanvas.Font.Assign(TFont(FWeekView.HeadAttributes.Font));
{ draw the header cell and borders }
if FWeekView.DrawingStyle = dsFlat then begin
{ draw an outer and inner bevel }
{ draw simple border rectangle }
HeadRect := Rect(RealLeft, RealTop, RealRight, RealTop + TVpWeekViewOpener(FWeekView).wvHeaderHeight + 2);
TPSFillRect(RenderCanvas, Angle, RenderIn, HeadRect);
{ wp: above lines replace the next ones - no bevel in flat style!
HeadRect.Left := RealLeft + 1;
HeadRect.Top := RealTop + 1;
HeadRect.Right := RealRight - 1;
HeadRect.Bottom := HeadRect.Top + wvHeaderHeight;
TPSFillRect (RenderCanvas, Angle, RenderIn, HeadRect);
DrawBevelRect (RenderCanvas,
TPSRotateRectangle (Angle, RenderIn, HeadRect),
BevelHighlightColor, BevelShadowColor);
}
end else
if FWeekView.DrawingStyle = ds3d then begin
{ draw a 3d bevel }
HeadRect.Left := RealLeft + 2;
HeadRect.Top := RealTop + 2;
HeadRect.Right := RealRight - 3;
HeadRect.Bottom := RealTop + TVpWeekViewOpener(FWeekView).wvHeaderHeight;
HeadRect.Bottom := RealTop + TVpWeekViewOpener(FWeekView).wvHeaderHeight + 2;
TPSFillRect(RenderCanvas, Angle, RenderIn, HeadRect);
DrawBevelRect(
RenderCanvas,
@ -554,12 +545,8 @@ begin
BevelHighlightColor,
BevelDarkShadow
);
end else begin
HeadRect.Left := RealLeft + 1;
HeadRect.Top := RealTop + 1;
HeadRect.Right := RealRight - 1;
HeadRect.Bottom := HeadRect.Top + TVpWeekViewOpener(FWeekView).wvHeaderHeight;
end;
end else
raise Exception.Create('DrawingStyle not supported.');
{ build header caption }
weekNo := GetWeekOfYear(StartDate);
@ -568,8 +555,7 @@ begin
]);
{ draw the text }
if DisplayOnly and (RenderCanvas.TextWidth(HeadStr) >= WidthOf(RenderIn))
then
if DisplayOnly and (RenderCanvas.TextWidth(HeadStr) >= WidthOf(RenderIn)) then
HeadTextRect.TopLeft:= Point(RealLeft + TextMargin * 2, HeadRect.Top)
else
if DisplayOnly then