- fix: editor's font size set by ctrl+mouse wheel will be reset by open the option dialog

This commit is contained in:
Roy Qu 2022-02-03 07:45:59 +08:00
parent 50a39a08c7
commit bf422ad419
3 changed files with 5 additions and 1 deletions

View File

@ -11,6 +11,7 @@ Red Panda C++ Version 0.14.1
- enhancement: new contrast theme, contributed by Alan-CRL
- enhancement: theme now have default icon set
- fix: wrong icons for file associations
- fix: editor's font size set by ctrl+mouse wheel will be reset by open the option dialog
Red Panda C++ Version 0.14.0
- enhancement: custom icon set ( in the configuration folder)

View File

@ -505,12 +505,14 @@ void Editor::wheelEvent(QWheelEvent *event) {
if (event->angleDelta().y()>0) {
size = std::min(99,size+1);
pSettings->editor().setFontSize(size);
pSettings->editor().save();
pMainWindow->updateEditorSettings();
event->accept();
return;
} else if (event->angleDelta().y()<0) {
size = std::max(2,size-1);
pSettings->editor().setFontSize(size);
pSettings->editor().save();
pMainWindow->updateEditorSettings();
event->accept();
return;

View File

@ -70,6 +70,7 @@ void EnvironmentAppearenceWidget::doSave()
PAppTheme appTheme = themeManager.theme(ui->cbTheme->currentData().toString());
if (appTheme && !appTheme->defaultColorScheme().isEmpty()) {
pSettings->editor().setColorScheme(appTheme->defaultColorScheme());
pSettings->editor().save();
pMainWindow->updateEditorColorSchemes();
}
}
@ -81,7 +82,7 @@ void EnvironmentAppearenceWidget::doSave()
pSettings->environment().setUseCustomIconSet(ui->chkUseCustomIconSet->isChecked());
pSettings->environment().setUseCustomTheme(ui->chkUseCustomTheme->isChecked());
pSettings->editor().save();
pSettings->environment().save();
pMainWindow->applySettings();
}