فهرست منبع

TSetupForm: Don't center inside a hidden or minimized form.

Jordan Russell 8 ماه پیش
والد
کامیت
e216aae90d
1فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  1. 7 0
      Projects/Src/Setup.SetupForm.pas

+ 7 - 0
Projects/Src/Setup.SetupForm.pas

@@ -331,6 +331,13 @@ procedure TSetupForm.CenterInsideControl(const Ctl: TWinControl;
 var
 var
   R: TRect;
   R: TRect;
 begin
 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 not InsideClientArea then begin
     if GetWindowRect(Ctl.Handle, R) then
     if GetWindowRect(Ctl.Handle, R) then
       CenterInsideRect(R);
       CenterInsideRect(R);