Skip to content

Commit

Permalink
TSetupForm: Don't center inside a hidden or minimized form.
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanrussell authored Dec 20, 2024
1 parent 3dc9943 commit e216aae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Projects/Src/Setup.SetupForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,13 @@ procedure TSetupForm.CenterInsideControl(const Ctl: TWinControl;
var
R: TRect;
begin
const CtlForm = GetParentForm(Ctl);
if (CtlForm = nil) or not IsWindowVisible(CtlForm.Handle) or
IsIconic(CtlForm.Handle) then begin
Center;
Exit;
end;

if not InsideClientArea then begin
if GetWindowRect(Ctl.Handle, R) then
CenterInsideRect(R);
Expand Down

0 comments on commit e216aae

Please sign in to comment.