diff -r 6da096930534 -r 9b655f6fe5a1 src/mainwindow.cpp --- a/src/mainwindow.cpp Sat Mar 05 17:18:44 2022 +0200 +++ b/src/mainwindow.cpp Sat Mar 05 18:26:18 2022 +0200 @@ -88,6 +88,7 @@ this->setRenderStyle(data.payload); }); } + connect(this->ui->actionDrawAxes, &QAction::triggered, this, &MainWindow::setDrawAxes); this->updateTitle(); this->restoreStartupSettings(); this->restoreSettings(); @@ -265,6 +266,13 @@ this->updateRenderPreferences(); } +void MainWindow::setDrawAxes(bool drawAxes) +{ + this->renderPreferences.drawAxes = drawAxes; + this->saveSettings(); + this->updateRenderPreferences(); +} + /** * @brief Handles the "Save" (Ctrl+S) action */ @@ -437,6 +445,7 @@ QAction* action = data.memberInstance(this->ui.get()); action->setChecked(this->renderPreferences.style == data.payload); } + this->ui->actionDrawAxes->setChecked(this->renderPreferences.drawAxes); } /** @@ -448,6 +457,7 @@ this->settings.setRecentFiles(this->recentlyOpenedFiles); this->settings.setMainSplitterState(this->documentSplitterState); this->settings.setRenderStyle(static_cast(this->renderPreferences.style)); + this->settings.setDrawAxes(this->renderPreferences.drawAxes); this->libraries.storeToSettings(&this->settings); } @@ -469,6 +479,7 @@ this->renderPreferences.lineThickness = this->settings.lineThickness(); this->renderPreferences.lineAntiAliasing = this->settings.lineAntiAliasing(); this->renderPreferences.selectedColor = this->settings.selectedColor(); + this->renderPreferences.drawAxes = this->settings.drawAxes(); const QString systemLocale = QLocale::system().name(); const QVariant defaultLocale = this->settings.locale(); this->changeLanguage(defaultLocale.toString());