- fix: Theme manager not correctly inited in options dialog / environment / appearance.

This commit is contained in:
Roy Qu 2024-04-06 18:36:35 +08:00
parent 17fddff91b
commit e98fb56f8d
2 changed files with 4 additions and 0 deletions

View File

@ -124,6 +124,7 @@ Red Panda C++ Version 2.27
- fix: Compiler set options "Check for stack smashing attacks (-fstack-protector)" was not correctly applied when compiling. - fix: Compiler set options "Check for stack smashing attacks (-fstack-protector)" was not correctly applied when compiling.
- fix: can't jump to definition/declaration for symbols in using alias statement like "using ::printf". - fix: can't jump to definition/declaration for symbols in using alias statement like "using ::printf".
- fix: Don't show completion suggestion for members of variable which type name has namespace alias; - fix: Don't show completion suggestion for members of variable which type name has namespace alias;
- fix: Theme manager not correctly inited in options dialog / environment / appearance.
Red Panda C++ Version 2.26 Red Panda C++ Version 2.26
- enhancement: Code suggestion for embedded std::vectors. - enhancement: Code suggestion for embedded std::vectors.

View File

@ -68,6 +68,7 @@ void EnvironmentAppearanceWidget::doSave()
{ {
if (pSettings->environment().theme()!=ui->cbTheme->currentData().toString()) { if (pSettings->environment().theme()!=ui->cbTheme->currentData().toString()) {
ThemeManager themeManager; ThemeManager themeManager;
themeManager.setUseCustomTheme(pSettings->environment().useCustomTheme());
PAppTheme appTheme = themeManager.theme(ui->cbTheme->currentData().toString()); PAppTheme appTheme = themeManager.theme(ui->cbTheme->currentData().toString());
if (appTheme && !appTheme->defaultColorScheme().isEmpty()) { if (appTheme && !appTheme->defaultColorScheme().isEmpty()) {
pSettings->editor().setColorScheme(appTheme->defaultColorScheme()); pSettings->editor().setColorScheme(appTheme->defaultColorScheme());
@ -93,6 +94,7 @@ void EnvironmentAppearanceWidget::doSave()
void EnvironmentAppearanceWidget::init() void EnvironmentAppearanceWidget::init()
{ {
ThemeManager themeManager; ThemeManager themeManager;
themeManager.setUseCustomTheme(pSettings->environment().useCustomTheme());
QList<PAppTheme> appThemes = themeManager.getThemes(); QList<PAppTheme> appThemes = themeManager.getThemes();
foreach(const PAppTheme& appTheme, appThemes) { foreach(const PAppTheme& appTheme, appThemes) {
ui->cbTheme->addItem(appTheme->displayName(),appTheme->name()); ui->cbTheme->addItem(appTheme->displayName(),appTheme->name());
@ -111,6 +113,7 @@ void EnvironmentAppearanceWidget::init()
void EnvironmentAppearanceWidget::on_cbTheme_currentIndexChanged(int /* index */) void EnvironmentAppearanceWidget::on_cbTheme_currentIndexChanged(int /* index */)
{ {
ThemeManager themeManager; ThemeManager themeManager;
themeManager.setUseCustomTheme(pSettings->environment().useCustomTheme());
PAppTheme appTheme = themeManager.theme(ui->cbTheme->currentData().toString()); PAppTheme appTheme = themeManager.theme(ui->cbTheme->currentData().toString());
if (appTheme && !appTheme->defaultIconSet().isEmpty()) { if (appTheme && !appTheme->defaultIconSet().isEmpty()) {
for (int i=0; i<ui->cbIconSet->count();i++) { for (int i=0; i<ui->cbIconSet->count();i++) {