mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 05:58:15 +02:00
Fix issue #39923 (AnchorDocking Docked forms sometimes overlap)
This commit is contained in:
parent
04ffdbc374
commit
989070fa91
@ -489,6 +489,7 @@ type
|
||||
procedure StoreConstraints;
|
||||
function GetSitePreferredClientSize: TPoint;
|
||||
function IsEnabledControl(Control: TControl):Boolean; override;
|
||||
function CanBeDoubleDocked:Boolean; override;
|
||||
|
||||
property Site: TWinControl read FSite; // the associated TControl (a TAnchorDockHostSite or a custom dock site)
|
||||
property DockSite: TAnchorDockHostSite read FDockSite; // if Site is a TAnchorDockHostSite, this is it
|
||||
@ -7560,6 +7561,11 @@ begin
|
||||
Result := (DockMaster <> nil) and DockMaster.IsSite(Control);
|
||||
end;
|
||||
|
||||
function TAnchorDockManager.CanBeDoubleDocked:Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
{ TAnchorDockSplitter }
|
||||
|
||||
procedure TAnchorDockSplitter.SetResizeAnchor(const AValue: TAnchorKind);
|
||||
|
@ -624,6 +624,7 @@ type
|
||||
procedure SetReplacingControl(Control: TControl); virtual;
|
||||
function AutoFreeByControl: Boolean; virtual;
|
||||
function IsEnabledControl(Control: TControl):Boolean; virtual;
|
||||
function CanBeDoubleDocked:Boolean; virtual;
|
||||
end;
|
||||
|
||||
TDockManagerClass = class of TDockManager;
|
||||
@ -4638,6 +4639,11 @@ begin
|
||||
|
||||
end;
|
||||
|
||||
function TDockManager.CanBeDoubleDocked:Boolean;
|
||||
begin
|
||||
result:=true;
|
||||
end;
|
||||
|
||||
function TDockManager.IsEnabledControl(Control: TControl):Boolean;
|
||||
begin
|
||||
Result := true;
|
||||
|
@ -367,6 +367,25 @@ procedure TDockPerformer.DragMove(APosition: TPoint);
|
||||
end;
|
||||
end;
|
||||
|
||||
function IsClientChildOfControl(AControl:TWinControl): Boolean;
|
||||
var
|
||||
Client:TControl;
|
||||
begin
|
||||
Result := False;
|
||||
Client := FDockObject.Control;
|
||||
if Assigned(AControl) then
|
||||
while Assigned(Client) do
|
||||
begin
|
||||
if AControl=Client then
|
||||
begin
|
||||
Result := True;
|
||||
exit;
|
||||
end;
|
||||
Client := Client.Parent;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
function FindDockSiteAtPosition: TWinControl;
|
||||
//Replace with lookup in Screen.Zorder(?)
|
||||
var
|
||||
@ -416,6 +435,8 @@ procedure TDockPerformer.DragMove(APosition: TPoint);
|
||||
if not AControl.IsVisible then continue;
|
||||
if AControl=FDockObject.Control then continue;
|
||||
if IsControlChildOfClient(AControl) then continue;
|
||||
if not AControl.DockManager.CanBeDoubleDocked then
|
||||
if IsClientChildOfControl(AControl) then continue;
|
||||
|
||||
if ItCanBeHostSite then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user