build/windows: Fix buttons bar glitch on Installer /SILENT mode

This commit is contained in:
Bruno Lopes 2025-04-25 13:10:34 -03:00
parent 1d2add6606
commit fa6854a896
No known key found for this signature in database

View file

@ -736,69 +736,71 @@ var
procedure UpdateWizardImages(); procedure UpdateWizardImages();
var TopBitmap,BottomBitmap: TFileStream; var TopBitmap,BottomBitmap: TFileStream;
begin begin
//Automatically scaled splash image if not WizardSilent then begin
WelcomeBitmapTop := TBitmapImage.Create(WizardForm.WelcomePage); //Automatically scaled splash image
with WelcomeBitmapTop do WelcomeBitmapTop := TBitmapImage.Create(WizardForm.WelcomePage);
begin with WelcomeBitmapTop do
Parent := WizardForm.WelcomePage; begin
Width := WizardForm.WelcomePage.ClientWidth Parent := WizardForm.WelcomePage;
Height := 1080 * Width / 1920 Width := WizardForm.WelcomePage.ClientWidth
Left := 0; Height := 1080 * Width / 1920
Top := (WizardForm.ClientHeight - Height) / 2; Left := 0;
AutoSize := False; Top := (WizardForm.ClientHeight - Height) / 2;
Stretch := True; AutoSize := False;
Center := True; Stretch := True;
end; Center := True;
try
if WelcomeBitmapTop.Height <= 314 then begin
TopBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_top.scale-100.bmp'),fmOpenRead);
end else if WelcomeBitmapTop.Height <= 386 then begin
TopBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_top.scale-125.bmp'),fmOpenRead);
end else if WelcomeBitmapTop.Height <= 459 then begin
TopBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_top.scale-150.bmp'),fmOpenRead);
end else if WelcomeBitmapTop.Height <= 556 then begin
TopBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_top.scale-175.bmp'),fmOpenRead);
end else if WelcomeBitmapTop.Height <= 604 then begin
TopBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_top.scale-200.bmp'),fmOpenRead);
end else if WelcomeBitmapTop.Height <= 700 then begin
TopBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_top.scale-225.bmp'),fmOpenRead);
end else begin
TopBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_top.scale-250.bmp'),fmOpenRead);
end; end;
DebugMsg('UpdateWizardImages','Height: ' + IntToStr(WelcomeBitmapTop.Height)); try
WizardForm.WizardBitmapImage.Bitmap.LoadFromStream(TopBitmap); if WelcomeBitmapTop.Height <= 314 then begin
WelcomeBitmapTop.Bitmap := WizardForm.WizardBitmapImage.Bitmap; TopBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_top.scale-100.bmp'),fmOpenRead);
except end else if WelcomeBitmapTop.Height <= 386 then begin
DebugMsg('UpdateWizardImages','Error loading image: ' + GetExceptionMessage); TopBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_top.scale-125.bmp'),fmOpenRead);
finally end else if WelcomeBitmapTop.Height <= 459 then begin
if TopBitmap <> nil then TopBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_top.scale-150.bmp'),fmOpenRead);
TopBitmap.Free; end else if WelcomeBitmapTop.Height <= 556 then begin
end; TopBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_top.scale-175.bmp'),fmOpenRead);
WizardForm.WelcomePage.Color := clNone; end else if WelcomeBitmapTop.Height <= 604 then begin
TopBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_top.scale-200.bmp'),fmOpenRead);
end else if WelcomeBitmapTop.Height <= 700 then begin
TopBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_top.scale-225.bmp'),fmOpenRead);
end else begin
TopBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_top.scale-250.bmp'),fmOpenRead);
end;
DebugMsg('UpdateWizardImages','Height: ' + IntToStr(WelcomeBitmapTop.Height));
WizardForm.WizardBitmapImage.Bitmap.LoadFromStream(TopBitmap);
WelcomeBitmapTop.Bitmap := WizardForm.WizardBitmapImage.Bitmap;
except
DebugMsg('UpdateWizardImages','Error loading image: ' + GetExceptionMessage);
finally
if TopBitmap <> nil then
TopBitmap.Free;
end;
WizardForm.WelcomePage.Color := clNone;
//Blurred background //Blurred background
WelcomeBitmapBottom := TBitmapImage.Create(WizardForm); WelcomeBitmapBottom := TBitmapImage.Create(WizardForm);
with WelcomeBitmapBottom do with WelcomeBitmapBottom do
begin begin
Left := 0; Left := 0;
Top := 0; Top := 0;
Parent := WizardForm; Parent := WizardForm;
Width := WizardForm.ClientWidth; Width := WizardForm.ClientWidth;
Height := WizardForm.ClientHeight; Height := WizardForm.ClientHeight;
Stretch := True; Stretch := True;
end; end;
try try
BottomBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_bottom.bmp'),fmOpenRead); BottomBitmap := TFileStream.Create(ExpandConstant('{tmp}\installsplash_bottom.bmp'),fmOpenRead);
WizardForm.WizardBitmapImage.Bitmap.LoadFromStream(BottomBitmap); WizardForm.WizardBitmapImage.Bitmap.LoadFromStream(BottomBitmap);
WelcomeBitmapBottom.Bitmap := WizardForm.WizardBitmapImage.Bitmap; WelcomeBitmapBottom.Bitmap := WizardForm.WizardBitmapImage.Bitmap;
except except
DebugMsg('UpdateWizardImages','Error loading image: ' + GetExceptionMessage); DebugMsg('UpdateWizardImages','Error loading image: ' + GetExceptionMessage);
finally finally
if BottomBitmap <> nil then if BottomBitmap <> nil then
BottomBitmap.Free; BottomBitmap.Free;
end; end;
WizardForm.WizardBitmapImage.Width := WizardForm.ClientWidth; WizardForm.WizardBitmapImage.Width := WizardForm.ClientWidth;
WizardForm.WizardBitmapImage.Height := WizardForm.ClientHeight; WizardForm.WizardBitmapImage.Height := WizardForm.ClientHeight;
end;
end; end;
procedure PrepareWelcomePage(); procedure PrepareWelcomePage();