diff --git a/components/tvplanit/source/vpdayview.pas b/components/tvplanit/source/vpdayview.pas index 6bb50ae77..f1eba1fae 100644 --- a/components/tvplanit/source/vpdayview.pas +++ b/components/tvplanit/source/vpdayview.pas @@ -2348,8 +2348,8 @@ begin dvInPlaceEditor.SetBounds( dvActiveIconRec.Right + TextMargin, dvActiveEventRec.Top + TextMargin, - dvActiveEventRec.Right - dvActiveIconRec.Right - TextMargin, - dvActiveEventRec.Bottom - dvActiveEventRec.Top - TextMargin + WidthOf(dvActiveEventRec) - dvActiveIconRec.Right - TextMargin*2, + HeightOf(dvActiveEventRec) - TextMargin ); dvInPlaceEditor.Show; dvInPlaceEditor.Text := FActiveEvent.Description; diff --git a/components/tvplanit/source/vpweekview.pas b/components/tvplanit/source/vpweekview.pas index fa6ab37b5..8b5216775 100644 --- a/components/tvplanit/source/vpweekview.pas +++ b/components/tvplanit/source/vpweekview.pas @@ -145,6 +145,7 @@ type FDefaultPopup: TPopupMenu; FDragDropTransparent: Boolean; FDrawingStyle: TVpDrawingStyle; + FGutterWidth: Integer; FEventFont: TVpFont; // was: TFont FExternalPopup: TPopupMenu; FHeadAttr: TVpWvHeadAttributes; @@ -320,6 +321,7 @@ type property ActiveEvent: TVpEvent read FActiveEvent write SetActiveEvent; property Date: TDateTime read FActiveDate write SetActiveDate; + property GutterWidth: Integer read FGutterWidth; property VisibleLines: Integer read FVisibleLines; property PrevWeekBtn: TSpeedButton read FPrevWeekBtn; @@ -607,8 +609,8 @@ begin wvStartDate := trunc(GetStartOfWeek(Now, FWeekStartsOn)); FTimeFormat := tf12Hour; FDateLabelFormat := 'ddddd'; -// FColumnWidth := 200; FAllowInplaceEdit := true; + FGutterWidth := 6; { set up fonts and colors } FDayHeadAttributes.Font.Size := 10; @@ -1739,16 +1741,16 @@ begin if ActiveEvent.AllDayEvent then wvInPlaceEditor.SetBounds( wvActiveEventRec.Left + TextMargin, - wvActiveEventRec.Top, - wvActiveEventRec.Right - TextMargin * 3, - wvActiveEventRec.Bottom - TextMargin * 2 + wvActiveEventRec.Top + TextMargin, + WidthOf(wvActiveEventRec) - TextMargin * 2 - 1, + HeightOf(wvActiveEventRec) - TextMargin * 2 ) else wvInPlaceEditor.SetBounds( - wvActiveEventRec.Left + TextMargin, - wvActiveEventRec.Top, - wvActiveEventRec.Right - TextMargin * 2, - wvActiveEventRec.Bottom - TextMargin * 2 + wvActiveEventRec.Left + FGutterWidth + TextMargin, + wvActiveEventRec.Top + TextMargin, + WidthOf(wvActiveEventRec) - TextMargin - FGutterWidth - 1, + HeightOf(wvActiveEventRec) - 2*TextMargin ); wvInplaceEditor.Show; wvInPlaceEditor.Text := ActiveEvent.Description; @@ -1985,6 +1987,7 @@ begin begin FTextMargin := round(FTextMargin * AXProportion); FHeaderMargin := round(FHeaderMargin * AXProportion); + FGutterWidth := round(FGutterWidth * AXProportion); end; end; {$IFEND} diff --git a/components/tvplanit/source/vpweekviewpainter.pas b/components/tvplanit/source/vpweekviewpainter.pas index c54d512ae..508106d9e 100644 --- a/components/tvplanit/source/vpweekviewpainter.pas +++ b/components/tvplanit/source/vpweekviewpainter.pas @@ -512,8 +512,6 @@ end; procedure TVpWeekViewPainter.DrawEvent(AEvent: TVpEvent; TextRect: TRect; ADayIndex: Integer); -const - GUTTER_WIDTH = 6; var dayStr: String; todayStartTime: TDateTime; @@ -558,9 +556,9 @@ begin TPSFillRect(RenderCanvas, Angle, RenderIn, TextRect); R := TextRect; {$IF VP_LCL_SCALING > 0} - R.Right := R.Left + FWeekView.Scale96ToFont(GUTTER_WIDTH); + R.Right := R.Left + FWeekView.Scale96ToFont(FWeekView.GutterWidth); {$ELSE} - R.Right := R.Left + ScaleX(GUTTER_WIDTH, DesignTimeDPI); + R.Right := R.Left + ScaleX(FWeekView.GutterWidth, DesignTimeDPI); {$IFEND} TextRect.Left := R.Right; RenderCanvas.Brush.Color := eventCat.Color; @@ -786,7 +784,7 @@ begin else StartDate := GetStartOfWeek(RenderDate, WeekStartsOn); - wvRowHeight := GetCanvasTextHeight(RenderCanvas, EventFont, VpProductName); + wvRowHeight := GetCanvasTextHeight(RenderCanvas, EventFont, VpProductName) + TextMargin * 2; Self.FDayHeadHeight := GetCanvasTextHeight(RenderCanvas, DayHeadAttributes.Font) + TextMargin * 2;