As a LibreOffice user, you have certainly seen the LibreOffice splash screen. It is displayed when you open LibreOffice, it has a progress bar, and when loading the application is finished it goes away. Here we discuss a suggested improvement for this splash screen.
Current Implementation Approach
Currently, the splash screen is implemented by creating a custom widget with a custom painting mechanism that draws the splash image and also the progress bar and moves the progress indicator.
This has some drawbacks:
1. The splash screen does not always scale to the same size as the main LibreOffice Window.
2. The style of the progress bar is somehow different from other UI elements, looks mostly like gen interface.
3. It needs and uses a custom paint code.
4. It does not conform to the dark/light theme.
5. It is not easily localize-able. In fact, the only text is from the displayed image, in English. When you build from sources, the image file is instdir/program/intro.png
.

LibreOffice splash screen bitmap
6. It is a separate binary (oosplash
). You may run it with:
$ ./instdir/program/oosplash

LibreOffice dev splash screen
VCL Weld Mechanism
I have previously written about VCL weld mechanism, which is based on creating user interface files (.ui) and loading them inside the application.
The weld mechanism greatly reduces the complexity of creating user interfaces, and also improves other aspects of the user interface, including the consistency.
Code Pointers
Most of the code for the current implementation resides in:
desktop/source/splash/splash.cxx.
The SplashScreenWindow
class has an custom paint method, SplashScreenWindow::Paint()
, which draws the bitmap, and also the progress. A new UI file is needed for this purpose, which should use GtkProgressBar, which will be considered a weld::ProgressBar. VCL then uses appropriate progress bar widget in different graphical plugins of VCL.
You may look into some dialogs like tip of the day to get some insight:
It would be interesting to avoid a separate binary, but it is fine to keep things as is, and just change to use .ui file.
Final Words
You may also use ideas from a minimal weld application here: