I have had a look at videowindow widget. In the process of analyzing its workflow, prior to optimize its behavior, if possible, I have found some minor fixes, not fully related to its optimization, although as well, that makes the user experience more robust, in my opinion. Due to complexity of the workflow, some weird behaviors remained unfixed:
- VideoWindow::startPlayback() was called twice from TrainSidebar::Start() I have not found any reason. Not relevant, but unneccessary
- Stopping and starting a workout made the video to be deselected, due to the complex workflow to take into account a change or deselection of workout. So, the video was not seen afterwards. If you wanted to stop and start again the same workout, you needed to stop/start an even number of times.
- The most relevant: when swicthing the layout to a one without video, video widgets remained visible, overlapping the layout. This is very annoying when starting a training session with no video: odd number of starts show videow widgets overlapped (in particular, the first start)
This is due to: all widgets of all train layouts are created when slecting train view, none of the widgets are hidden when they are not necessary, and the odd number of starts required is due to previous point
Some of them (hiding/showing widgets) is relevant for the optimization of the widgets, but can be implemented beforehand. I think these changes are useful, so I am asking for a PR, and you can tell me whether it is ok, can be revised, or rejected if not necessary.
I will continue with hiding/showing and not computing widgets when not necessary, if possible.