Splash Screen minimal show time. Issue #16264
This commit is contained in:
committed by
Chris Hennes
parent
a715a4d161
commit
9b409da59c
@@ -1917,13 +1917,18 @@ void MainWindow::startSplasher()
|
||||
GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("General");
|
||||
// first search for an external image file
|
||||
if (hGrp->GetBool("ShowSplasher", true)) {
|
||||
d->splashscreen = new SplashScreen(this->splashImage());
|
||||
const auto isWayland = qGuiApp->platformName() == QLatin1String("wayland");
|
||||
const auto flags = isWayland ? Qt::WindowFlags() : Qt::WindowStaysOnTopHint | Qt::X11BypassWindowManagerHint;
|
||||
d->splashscreen = new SplashScreen(this->splashImage(), flags);
|
||||
|
||||
if (!hGrp->GetBool("ShowSplasherMessages", false)) {
|
||||
d->splashscreen->setShowMessages(false);
|
||||
}
|
||||
|
||||
d->splashscreen->show();
|
||||
if (!isWayland) {
|
||||
QApplication::processEvents();
|
||||
}
|
||||
}
|
||||
else {
|
||||
d->splashscreen = nullptr;
|
||||
@@ -1933,11 +1938,24 @@ void MainWindow::startSplasher()
|
||||
|
||||
void MainWindow::stopSplasher()
|
||||
{
|
||||
if (d->splashscreen) {
|
||||
d->splashscreen->finish(this);
|
||||
delete d->splashscreen;
|
||||
d->splashscreen = nullptr;
|
||||
const auto isWayland = qGuiApp->platformName() == QLatin1String("wayland");
|
||||
if (isWayland) {
|
||||
if (d->splashscreen) {
|
||||
d->splashscreen->finish(this);
|
||||
d->splashscreen->deleteLater();
|
||||
d->splashscreen = nullptr;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
QApplication::processEvents();
|
||||
QTimer::singleShot(3000, this, [this]() {
|
||||
if (d->splashscreen) {
|
||||
d->splashscreen->finish(this);
|
||||
d->splashscreen->deleteLater();
|
||||
d->splashscreen = nullptr;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
QPixmap MainWindow::aboutImage() const
|
||||
|
||||
@@ -212,6 +212,7 @@ void StartupPostProcess::setLoadFromPythonModule(bool value)
|
||||
|
||||
void StartupPostProcess::execute()
|
||||
{
|
||||
showSplashScreen();
|
||||
setWindowTitle();
|
||||
setProcessMessages();
|
||||
setAutoSaving();
|
||||
@@ -420,7 +421,7 @@ bool StartupPostProcess::hiddenMainWindow() const
|
||||
return hidden;
|
||||
}
|
||||
|
||||
void StartupPostProcess::showMainWindow()
|
||||
void StartupPostProcess::showSplashScreen()
|
||||
{
|
||||
bool hidden = hiddenMainWindow();
|
||||
|
||||
@@ -428,7 +429,10 @@ void StartupPostProcess::showMainWindow()
|
||||
if (!hidden && !loadFromPythonModule) {
|
||||
mainWindow->startSplasher();
|
||||
}
|
||||
}
|
||||
|
||||
void StartupPostProcess::showMainWindow()
|
||||
{
|
||||
// running the GUI init script
|
||||
try {
|
||||
Base::Console().Log("Run Gui init script\n");
|
||||
|
||||
@@ -74,6 +74,7 @@ private:
|
||||
void setImportImageFormats();
|
||||
bool hiddenMainWindow() const;
|
||||
void showMainWindow();
|
||||
void showSplashScreen();
|
||||
void activateWorkbench();
|
||||
void checkParameters();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user