From 418b1a86147c8a01fb2aac35e187d6cea429ed2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 25 Sep 2022 11:05:13 +0200 Subject: [PATCH] Added missing "use styles" setting save/restore --- src/GUI/graphicsscene.cpp | 2 +- src/GUI/gui.cpp | 6 ++++++ src/GUI/settings.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/GUI/graphicsscene.cpp b/src/GUI/graphicsscene.cpp index bee469b6..acfba3f8 100644 --- a/src/GUI/graphicsscene.cpp +++ b/src/GUI/graphicsscene.cpp @@ -4,7 +4,7 @@ #include "graphicsscene.h" -bool GraphicsItem::_useStyle = false; +bool GraphicsItem::_useStyle = true; /* Standard GraphicsScene::items() is not pixel accurate, so we use the following function which has the same logic as used in the original diff --git a/src/GUI/gui.cpp b/src/GUI/gui.cpp index 91031b03..e766a858 100644 --- a/src/GUI/gui.cpp +++ b/src/GUI/gui.cpp @@ -2512,6 +2512,8 @@ void GUI::writeSettings() else if (_showMarkerCoordinatesAction->isChecked() && SHOW_MARKER_INFO_DEFAULT != MarkerInfoItem::Position) settings.setValue(SHOW_MARKER_INFO_SETTING, MarkerInfoItem::Position); + if (_useStylesAction->isChecked() != USE_STYLES_DEFAULT) + settings.setValue(USE_STYLES_SETTING, _useStylesAction->isChecked()); settings.endGroup(); settings.beginGroup(PDF_EXPORT_SETTINGS_GROUP); @@ -2859,6 +2861,10 @@ void GUI::readSettings(QString &activeMap, QStringList &disabledPOIs) _showMarkersAction->trigger(); } else _hideMarkersAction->trigger(); + if (settings.value(USE_STYLES_SETTING, USE_STYLES_DEFAULT).toBool()) { + _useStylesAction->setChecked(true); + } else + _mapView->useStyles(false); settings.endGroup(); settings.beginGroup(PDF_EXPORT_SETTINGS_GROUP); diff --git a/src/GUI/settings.h b/src/GUI/settings.h index db4cea31..b0d81816 100644 --- a/src/GUI/settings.h +++ b/src/GUI/settings.h @@ -86,6 +86,8 @@ #define SHOW_MARKERS_DEFAULT true #define SHOW_MARKER_INFO_SETTING "markerInfo" #define SHOW_MARKER_INFO_DEFAULT MarkerInfoItem::None +#define USE_STYLES_SETTING "styles" +#define USE_STYLES_DEFAULT true #define PDF_EXPORT_SETTINGS_GROUP "Export" #define PAPER_ORIENTATION_SETTING "orientation"