LCL: anchordocking: enlargecontrol: updating title

git-svn-id: trunk@14003 -
This commit is contained in:
mattias 2008-02-06 14:38:21 +00:00
parent 32a23b4bf2
commit cb9458c6c0

View File

@ -1,4 +1,3 @@
{ $Id$ }
{ {
/*************************************************************************** /***************************************************************************
LDockTree.pas LDockTree.pas
@ -1450,7 +1449,7 @@ end;
function TCustomAnchoredDockManager.GetPreferredTitlePosition(AWidth, function TCustomAnchoredDockManager.GetPreferredTitlePosition(AWidth,
AHeight: integer): TAnchorKind; AHeight: integer): TAnchorKind;
begin begin
if (AWidth<=AHeight) and (AWidth<200) then if AWidth>((AHeight*3) div 2) then
Result:=akLeft Result:=akLeft
else else
Result:=akTop; Result:=akTop;
@ -1460,13 +1459,18 @@ procedure TCustomAnchoredDockManager.UpdateTitlePosition(Control: TControl);
var var
TitlePos: TAnchorKind; TitlePos: TAnchorKind;
begin begin
TitlePos:=GetPreferredTitlePosition(Control.Width,Control.Height); if Control.Parent is TLazDockForm then begin
if TitlePos=akLeft then begin TitlePos:=GetPreferredTitlePosition(Control.Width,Control.Height);
Control.BorderSpacing.Left:=TitleWidth; if TitlePos=akLeft then begin
Control.BorderSpacing.Top:=0; Control.BorderSpacing.Left:=TitleWidth;
Control.BorderSpacing.Top:=0;
end else begin
Control.BorderSpacing.Left:=0;
Control.BorderSpacing.Top:=TitleHeight;
end;
end else begin end else begin
Control.BorderSpacing.Left:=0; Control.BorderSpacing.Left:=0;
Control.BorderSpacing.Top:=TitleHeight; Control.BorderSpacing.Top:=0;
end; end;
end; end;
@ -2205,6 +2209,7 @@ begin
end; end;
end; end;
end; end;
UpdateTitlePosition(Control);
end; end;
end else begin end else begin
@ -2253,6 +2258,8 @@ begin
MainSplitter.AnchorToNeighbour(ShrinkSide,0,EnlargeSplitter); MainSplitter.AnchorToNeighbour(ShrinkSide,0,EnlargeSplitter);
EnlargeSplitter.AnchorSame(Side,Neighbour); EnlargeSplitter.AnchorSame(Side,Neighbour);
Control.AnchorSame(Side,Neighbour); Control.AnchorSame(Side,Neighbour);
UpdateTitlePosition(Control);
UpdateTitlePosition(Neighbour);
end; end;
end; end;
finally finally