diff --git a/components/tvplanit/source/vpnavbar.pas b/components/tvplanit/source/vpnavbar.pas index 65639046a..79d8fa5c3 100644 --- a/components/tvplanit/source/vpnavbar.pas +++ b/components/tvplanit/source/vpnavbar.pas @@ -500,7 +500,7 @@ uses VpNavBarPainter; const - DEFAULT_ITEMSPACING = 8; + DEFAULT_ITEMSPACING = 12; {$IFNDEF PAINTER} {DrawNavTab - returns the usable text area inside the tab rect.} diff --git a/components/tvplanit/source/vpnavbarpainter.pas b/components/tvplanit/source/vpnavbarpainter.pas index 610a57787..fb7876c7a 100644 --- a/components/tvplanit/source/vpnavbarpainter.pas +++ b/components/tvplanit/source/vpnavbarpainter.pas @@ -591,8 +591,9 @@ begin AItem.LabelRect := R; bkMode := SetBkMode(Canvas.Handle, TRANSPARENT); - AHeight:= DrawText(Canvas.Handle, PChar(s), Length(s), R, DT_CENTER or DT_VCENTER or DT_WORDBREAK); + DrawText(Canvas.Handle, PChar(s), Length(s), R, DT_CENTER or DT_VCENTER or DT_WORDBREAK); SetBkMode(Canvas.Handle, bkMode); + AHeight := HeightOf(R); end else begin R.Top := CurPos; @@ -611,7 +612,6 @@ begin AItem.DisplayName := s; DrawText(Canvas.Handle, PChar(s), Length(s), R, DT_LEFT or DT_CALCRECT); txtWidth := WidthOf(R); - AHeight := HeightOf(R); R.Right := R.Left + txtWidth + 1; {$IFDEF MSWINDOWS} OffsetRect(R, 0, -1); // Better centering of text @@ -623,6 +623,7 @@ begin // AHeight := DrawText(Canvas.Handle, PChar(s), Length(s), R, DT_LEFT or DT_VCENTER); SetBkMode(Canvas.Handle, bkMode); + AHeight := HeightOf(R); if AHeight < FSmallImagesSize then AHeight := FSmallImagesSize; end; @@ -634,7 +635,7 @@ end; function TVpNavBarPainter.DrawLargeIcon(Canvas: TCanvas; AItem: TVpNavBtnItem; CurPos: Integer): Boolean; const - MARGIN = 2; + MARGIN = 1; var W, H: Integer; R: TRect; @@ -1098,7 +1099,8 @@ begin Right := 1; Bottom := 1; end; - SH := DrawText(Canvas.Handle, 'W W', 3, TestRect, DT_SINGLELINE or DT_CALCRECT); + DrawText(Canvas.Handle, 'W W', 3, TestRect, DT_SINGLELINE or DT_CALCRECT); + SH := HeightOf(TestRect); {get double line height} with TestRect do begin @@ -1107,7 +1109,8 @@ begin Right := 1; Bottom := 1; end; - DH := DrawText(Canvas.Handle, 'W W', 3, TestRect, DT_WORDBREAK or DT_CALCRECT); + DrawText(Canvas.Handle, 'W W', 3, TestRect, DT_WORDBREAK or DT_CALCRECT); + DH := HeightOf(TestRect); {see if the text can fit within the existing rect without growing} TestRect := Rect;