fix: Error when using custom theme
This commit is contained in:
parent
edf1424ce3
commit
5ae88452a9
1
NEWS.md
1
NEWS.md
|
@ -35,6 +35,7 @@ Red Panda C++ Version 2.26
|
|||
- Enhancement: Better support for macros.
|
||||
- Enhancement: Better type induction for auto in foreach loop of maps.
|
||||
- Enhancement: Better contrast for scroller slider in dark theme.
|
||||
- Enhancement: Using lua script in themes.
|
||||
|
||||
Red Panda C++ Version 2.25
|
||||
|
||||
|
|
|
@ -44,17 +44,17 @@ PAppTheme ThemeManager::theme(const QString &themeName)
|
|||
if (mUseCustomTheme)
|
||||
prepareCustomeTheme();
|
||||
PAppTheme appTheme = std::make_shared<AppTheme>();
|
||||
QString themeDir;
|
||||
if (mUseCustomTheme) {
|
||||
QString themeDir = pSettings->dirs().config(Settings::Dirs::DataType::Theme);
|
||||
appTheme->load(QString("%1/%2.json").arg(themeDir, themeName), AppTheme::ThemeType::JSON);
|
||||
themeDir = pSettings->dirs().config(Settings::Dirs::DataType::Theme);
|
||||
} else {
|
||||
QString themeDir = pSettings->dirs().data(Settings::Dirs::DataType::Theme);
|
||||
#ifdef ENABLE_LUA_ADDON
|
||||
appTheme->load(QString("%1/%2.lua").arg(themeDir, themeName), AppTheme::ThemeType::Lua);
|
||||
#else
|
||||
appTheme->load(QString("%1/%2.json").arg(themeDir, themeName), AppTheme::ThemeType::JSON);
|
||||
#endif
|
||||
themeDir = pSettings->dirs().data(Settings::Dirs::DataType::Theme);
|
||||
}
|
||||
#ifdef ENABLE_LUA_ADDON
|
||||
appTheme->load(QString("%1/%2.lua").arg(themeDir, themeName), AppTheme::ThemeType::Lua);
|
||||
#else
|
||||
appTheme->load(QString("%1/%2.json").arg(themeDir, themeName), AppTheme::ThemeType::JSON);
|
||||
#endif
|
||||
return appTheme;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue