mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 16:40:23 +02:00
TFindDialog: use Position := poMainFormCenter in CalcPosition instead of trying to calculate that by ourselves. Patch by Serge Anvarov.
git-svn-id: trunk@59049 -
This commit is contained in:
parent
a62fcc7e69
commit
d8993e1b36
@ -575,19 +575,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFindDialog.CalcPosition(aForm:Tform);
|
procedure TFindDialog.CalcPosition(aForm:Tform);
|
||||||
Var
|
|
||||||
MfBound : Trect;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
//debugln(['TFindDialog.CalcPosition: Left=',Left,', Top=',Top,', Position=',dbgs(position),', FFormLeft=',FFormLeft,', FFormTop=',FFormTop]);
|
//debugln(['TFindDialog.CalcPosition: Left=',Left,', Top=',Top,', Position=',dbgs(position),', FFormLeft=',FFormLeft,', FFormTop=',FFormTop]);
|
||||||
if (FFormLeft < 0) and (FFormTop < 0) then
|
if (FFormLeft < 0) and (FFormTop < 0) then
|
||||||
begin
|
begin
|
||||||
MfBound := Application.MainForm.BoundsRect;
|
aForm.Position := poMainFormCenter;
|
||||||
FFormTop := MfBound.Top + (((MfBound.Bottom - MfBound.Top) - aForm.Height) Div 2);
|
FFormTop := aForm.Top;
|
||||||
FFormLeft := MfBound.Left + (((MfBound.Right - MfBound.Left) - aForm.Width) Div 2);
|
FFormLeft := aForm.Left;
|
||||||
end;
|
end;
|
||||||
aForm.Top := FFormTop;
|
|
||||||
aForm.Left := FFormLeft;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user