Swapping themes causes a long client freeze
Describe the bug When pressing "reload theme" or receiving a subtheme from the server, there's a few seconds of lag before the user can use the client again.
To reproduce Steps to reproduce the behavior:
- Go to a server
- Click on reload theme
- It lags
Expected behavior There is little or no lag and the theme swapping is optimized
Version:
- OS: Windows 10
- Version or branch: master
Additional context I remember optimizing some of the lag before, but it got pretty bad again on master. We need a solution pretty bad especially since sub themes have a reload theme request
BRUH I JUST REALIZED WHY THIS IS HAPPENING. It loads and closes the config file, FOR EACH CONFIG OPTION IT READS.
The solution should be to just load the config file once and handle it from there...
Not as much of an issue anymore for Lobby since it mostly relies on Qt CSS and recreates the entire widget structure, but by lord this is still an issue for Courtroom.