gz-gui icon indicating copy to clipboard operation
gz-gui copied to clipboard

Splash screen support

Open peci1 opened this issue 2 years ago • 5 comments

Desired behavior

GUI can show a splash screen that disappears only when some specified plugins finish loading.

Alternatives considered

None.

Implementation suggestion

I don't know where to start as I'm not a Qt Quick guy. I've succeeded implementing a splash screen locally using QSplashScreen, but I've noticed that's not a Qt Quick component and it is in the QtWidgets part of Qt that is currently not requested in CMake. I found this tutorial for splash windows in Qt Quick: https://doc.qt.io/archives/qt-5.9/qtquick-window-splash-qml.html . However, after an hour of pondering, I wasn't able to get it working (I wanted to implement it as a GUI plugin, which might be a wrong way of doing it anyways).

Additional context

I assume that once the splash screen is working, the user should be able to specify the image to be displayed. How should relative paths be resolved in this case? Should they be resolved relative to one of the existing environment paths?

I was also thinking about creating a GuiEvent with a text parameter which could be emitted from plugins to signal to the splash screen the current state of loading.

When launching simple apps like the examples here, there's not enough time for a splash screen, but loading e.g final_event_04 world from SubT deserves one as the loading can take more than a minute. In the meantime, just a half-rendered non-responsive GUI is shown, which is anyways useless...

Last, I was thinking about how to figure out when to hide the splash screen. I haven't found any "GUI ready" event or message. Maybe that's even a bit complicated. As the case I was solving always contained a GzScene3D, I hooked /gui/camera/pose and hid the splash once the pose has changed from its first published value. I understand that this is not optimal and is only working in case a GzScene3D is in the config and a camera is set in follow mode. The implementation from Gazebo classic also hooks into the Scene3D and queries the readiness of rendering, but that resulted in premature hiding of the splash when I transplanted this approach to Ignition. One idea I had was creating a GuiEvent that would be emitted by plugins, and the GUI config would allow specifying that when a plugin of given name emits this event, the splash screen should be hidden.

peci1 avatar Dec 14 '21 14:12 peci1