LCL: TabControl fix paint border

git-svn-id: trunk@42565 -
This commit is contained in:
martin 2013-09-02 15:20:45 +00:00
parent 62dff1c501
commit 64c8d977b6
2 changed files with 12 additions and 4 deletions

View File

@ -593,7 +593,7 @@ end;
procedure TTabControl.Paint;
var
ARect: TRect;
ARect, ARect2: TRect;
TS: TTextStyle;
Details: TThemedElementDetails;
lCanvas: TCanvas;
@ -607,7 +607,15 @@ begin
AdjustDisplayRectWithBorder(ARect);
Details := ThemeServices.GetElementDetails(ttPane);
ThemeServices.DrawElement(lCanvas.Handle, Details, ARect);
ARect2 := ARect;
// paint 1 pixel under the header, to avoid painting a closing border
case TabPosition of
tpTop: ARect2.Top := ARect2.Top - 1;
tpBottom: ARect2.Bottom := ARect2.Bottom + 1;
tpLeft: ARect2.Left := ARect2.Left - 1;
tpRight: ARect2.Right := ARect2.Right + 1;
end;
ThemeServices.DrawElement(lCanvas.Handle, Details, ARect2);
InflateRect(ARect,BorderWidth,BorderWidth);
lCanvas.Frame3d(ARect, BorderWidth, bvRaised);

View File

@ -438,7 +438,7 @@ begin
// The bigger offset is the height of the tab
Result := Max(R.Top, -R.Bottom)
// but includes spacing for the child
- Min(R.Top, -R.Bottom) div 2;
- 1;
end;
class function TWin32WSCustomTabControl.GetNotebookMinTabWidth(const AWinControl: TWinControl): integer;
@ -455,7 +455,7 @@ begin
exit;
end;
Result := Max(R.Left, -R.Right)
- Min(R.Left, -R.Right) div 2;
- 1;
end;
{ -----------------------------------------------------------------------------