UPD & FIX: handle Splash Form consistently across all platforms, especially on MacOS

1. more Lazarus’ idioms for SplashForm (like Lazarus IDE)
2. SplashForm can be shown correctly on MacOS
3. improved display of SplashForm in Gt2k
4. tested on Win32, Gtk2, Qt5, Cocoa

(cherry picked from commit 623185b685)
This commit is contained in:
rich2014 2023-09-03 19:20:36 +08:00 committed by Alexander Koblov
commit 374ecc52a2
3 changed files with 15 additions and 7 deletions

View file

@ -230,13 +230,6 @@ begin
// in Application.CreateForm above.
uKeyboard.HookKeyboardLayoutChanged;
if (gSplashForm) and (not CommandLineParams.NoSplash) then
begin
// We may now remove the starting splash screen, most of the application has been started now
frmStartingSplash.Close;
frmStartingSplash.Release;
end;
frmMain.ShowOnTop;
{$IFDEF LCLCOCOA}
frmMain.RestoreWindow;

View file

@ -1019,6 +1019,8 @@ object frmStartingSplash: TfrmStartingSplash
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '2.0.12.0'
OnCreate = FormCreate
OnHide = FormHide
object pnlInfo: TPanel
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner

View file

@ -27,6 +27,8 @@ type
pnlVersionInfos: TPanel;
pnlInfo: TPanel;
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure FormHide(Sender: TObject);
private
{ private declarations }
public
@ -58,5 +60,16 @@ begin
lblWidgetsetVer.Caption := WSVersion;
end;
procedure TfrmStartingSplash.FormClose(Sender: TObject;
var CloseAction: TCloseAction);
begin
CloseAction:= caFree;
end;
procedure TfrmStartingSplash.FormHide(Sender: TObject);
begin
close();
end;
end.