diff --git a/src/Gui/Icons/freecadabout.png b/src/Gui/Icons/freecadabout.png new file mode 100644 index 0000000000..bfec76c2cb Binary files /dev/null and b/src/Gui/Icons/freecadabout.png differ diff --git a/src/Gui/Icons/resource.qrc b/src/Gui/Icons/resource.qrc index 28d9c0b170..9269f819ed 100644 --- a/src/Gui/Icons/resource.qrc +++ b/src/Gui/Icons/resource.qrc @@ -1,6 +1,7 @@ freecadsplash.png + freecadabout.png background.png mouse_pointer.svg Document.svg diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 73956a16f3..0be1e91e8d 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -1456,6 +1456,28 @@ void MainWindow::stopSplasher(void) } } +QPixmap MainWindow::aboutImage() const +{ + // See if we have a custom About screen image set + QPixmap about_image; + std::string about_path = App::Application::Config()["AboutImage"]; + if (!about_path.empty()) { + QString path = QString::fromUtf8(about_path.c_str()); + if (QDir(path).isRelative()) { + QString home = QString::fromUtf8(App::GetApplication().getHomePath()); + path = QFileInfo(QDir(home), path).absoluteFilePath(); + } + about_image.load(path); + + // Now try the icon paths + if (about_image.isNull()) { + about_image = Gui::BitmapFactory().pixmap(about_path.c_str()); + } + } + + return about_image; +} + QPixmap MainWindow::splashImage() const { // search in the UserAppData dir as very first diff --git a/src/Gui/MainWindow.h b/src/Gui/MainWindow.h index 17d0eb2b94..3c864eeaf1 100644 --- a/src/Gui/MainWindow.h +++ b/src/Gui/MainWindow.h @@ -135,6 +135,8 @@ public: void startSplasher(void); /** Stops the splasher after startup. */ void stopSplasher(void); + /* The image of the About dialog, it might be empty. */ + QPixmap aboutImage() const; /* The image of the splash screen of the application. */ QPixmap splashImage() const; /** Shows the online documentation. */ diff --git a/src/Gui/Splashscreen.cpp b/src/Gui/Splashscreen.cpp index 00e0913052..6a635f03e7 100644 --- a/src/Gui/Splashscreen.cpp +++ b/src/Gui/Splashscreen.cpp @@ -228,7 +228,14 @@ AboutDialog::AboutDialog(bool showLic, QWidget* parent) ui->setupUi(this); layout()->setSizeConstraint(QLayout::SetFixedSize); QRect rect = QApplication::primaryScreen()->availableGeometry(); - QPixmap image = getMainWindow()->splashImage(); + + // See if we have a custom About screen image set + QPixmap image = getMainWindow()->aboutImage(); + + // Fallback to the splashscreen image + if (image.isNull()) { + image = getMainWindow()->splashImage(); + } // Make sure the image is not too big int denom = 2; diff --git a/src/Main/MainGui.cpp b/src/Main/MainGui.cpp index ebdfe64f7d..47e2e53a3d 100644 --- a/src/Main/MainGui.cpp +++ b/src/Main/MainGui.cpp @@ -176,6 +176,7 @@ int main( int argc, char ** argv ) App::Application::Config()["CopyrightInfo"] = sBanner; App::Application::Config()["AppIcon"] = "freecad"; App::Application::Config()["SplashScreen"] = "freecadsplash"; + App::Application::Config()["AboutImage"] = "freecadabout"; App::Application::Config()["StartWorkbench"] = "StartWorkbench"; //App::Application::Config()["HiddenDockWindow"] = "Property editor"; App::Application::Config()["SplashAlignment" ] = "Bottom|Left";