mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-20 04:42:18 +02:00
UI: Apply default stylesheet before applying theme
This significantly improves performance when switching themes. The original intent was to "clear" customizations applied by the previously selected theme. This change does not seem to achieve that goal.
This commit is contained in:
parent
570c904977
commit
08cee21158
@ -1117,6 +1117,7 @@ bool OBSApp::SetTheme(std::string name, std::string path)
|
||||
}
|
||||
}
|
||||
|
||||
setStyleSheet(defaultStyleSheet);
|
||||
QString mpath = QString("file:///") + path.c_str();
|
||||
setPalette(defaultPalette);
|
||||
ParseExtraThemeData(path.c_str());
|
||||
@ -1132,6 +1133,7 @@ bool OBSApp::SetTheme(std::string name, std::string path)
|
||||
bool OBSApp::InitTheme()
|
||||
{
|
||||
defaultPalette = palette();
|
||||
defaultStyleSheet = styleSheet();
|
||||
|
||||
const char *themeName =
|
||||
config_get_string(globalConfig, "General", "CurrentTheme2");
|
||||
|
@ -74,6 +74,7 @@ class OBSApp : public QApplication {
|
||||
private:
|
||||
std::string locale;
|
||||
std::string theme;
|
||||
QString defaultStyleSheet;
|
||||
bool themeDarkMode = true;
|
||||
ConfigFile globalConfig;
|
||||
TextLookup textLookup;
|
||||
|
Loading…
Reference in New Issue
Block a user