From ef952f1651ea61107577befff996ebe758d8e9bb Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 12 May 2010 16:39:40 +0000 Subject: [PATCH] SourceEditor: Drag tabs, removed workaround for wrong tab-rect git-svn-id: trunk@25337 - --- ide/sourceeditor.pp | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index 00f8eb4ad6..2cebf83632 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -7562,25 +7562,20 @@ end; procedure TSourceDragableNotebook.PaintWindow(DC: HDC); var Points: Array [0..3] of TPoint; - h, x: Integer; + h: Integer; begin inherited PaintWindow(DC); + if not (TabPosition in [tpTop, tpBottom]) then exit; if FDragOverIndex < 0 then exit; - x := 0; - h := (Abs(FDragOverTabRect.Bottom - FDragOverTabRect.Top) - 4) div 2; + h := Min( (Abs(FDragOverTabRect.Bottom - FDragOverTabRect.Top) - 4) div 2, + (Abs(FDragOverTabRect.Left - FDragOverTabRect.Right) - 4) div 2 ); if FDragToRightSide then begin - if (FDragNextToTabRect.Left < FDragOverTabRect.Right) and - (FDragOverIndex < PageCount - 1) - then - x := FDragOverTabRect.Right - FDragNextToTabRect.Left - else - x := 8; - Points[0].X := FDragOverTabRect.Right - 2 - h - x; + Points[0].X := FDragOverTabRect.Right - 2 - h; Points[0].y := FDragOverTabRect.Top + 2; - Points[1].X := FDragOverTabRect.Right - 2 - h - x; + Points[1].X := FDragOverTabRect.Right - 2 - h; Points[1].y := FDragOverTabRect.Bottom - 2; - Points[2].X := FDragOverTabRect.Right - 2 - x; + Points[2].X := FDragOverTabRect.Right - 2; Points[2].y := FDragOverTabRect.Top + 2 + h; Points[3] := Points[0]; Polygon(DC, @Points, 4, False); @@ -7596,12 +7591,6 @@ begin Polygon(DC, @Points, 4, False); end; end else begin - if (FDragNextToTabRect.Right < FDragOverTabRect.Left) and - (FDragOverIndex > 1) - then - x := FDragOverTabRect.Left - FDragNextToTabRect.Right - else - x := 8; Points[0].X := FDragOverTabRect.Left + 2 + h; Points[0].y := FDragOverTabRect.Top + 2; Points[1].X := FDragOverTabRect.Left + 2 + h; @@ -7612,11 +7601,11 @@ begin Polygon(DC, @Points, 4, True); if (FDragOverIndex > 0) then begin - Points[0].X := FDragNextToTabRect.Right - 2 - h - x; + Points[0].X := FDragNextToTabRect.Right - 2 - h; Points[0].y := FDragNextToTabRect.Top + 2; - Points[1].X := FDragNextToTabRect.Right - 2 - h - x; + Points[1].X := FDragNextToTabRect.Right - 2 - h; Points[1].y := FDragNextToTabRect.Bottom - 2; - Points[2].X := FDragNextToTabRect.Right - 2 - x; + Points[2].X := FDragNextToTabRect.Right - 2; Points[2].y := FDragNextToTabRect.Top + 2 + h; Points[3] := Points[0]; Polygon(DC, @Points, 4, False);