1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Added missing "use styles" setting save/restore

This commit is contained in:
Martin Tůma 2022-09-25 11:05:13 +02:00
parent a59e7a058d
commit 418b1a8614
3 changed files with 9 additions and 1 deletions

View File

@ -4,7 +4,7 @@
#include "graphicsscene.h" #include "graphicsscene.h"
bool GraphicsItem::_useStyle = false; bool GraphicsItem::_useStyle = true;
/* Standard GraphicsScene::items() is not pixel accurate, so we use the /* Standard GraphicsScene::items() is not pixel accurate, so we use the
following function which has the same logic as used in the original following function which has the same logic as used in the original

View File

@ -2512,6 +2512,8 @@ void GUI::writeSettings()
else if (_showMarkerCoordinatesAction->isChecked() else if (_showMarkerCoordinatesAction->isChecked()
&& SHOW_MARKER_INFO_DEFAULT != MarkerInfoItem::Position) && SHOW_MARKER_INFO_DEFAULT != MarkerInfoItem::Position)
settings.setValue(SHOW_MARKER_INFO_SETTING, 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.endGroup();
settings.beginGroup(PDF_EXPORT_SETTINGS_GROUP); settings.beginGroup(PDF_EXPORT_SETTINGS_GROUP);
@ -2859,6 +2861,10 @@ void GUI::readSettings(QString &activeMap, QStringList &disabledPOIs)
_showMarkersAction->trigger(); _showMarkersAction->trigger();
} else } else
_hideMarkersAction->trigger(); _hideMarkersAction->trigger();
if (settings.value(USE_STYLES_SETTING, USE_STYLES_DEFAULT).toBool()) {
_useStylesAction->setChecked(true);
} else
_mapView->useStyles(false);
settings.endGroup(); settings.endGroup();
settings.beginGroup(PDF_EXPORT_SETTINGS_GROUP); settings.beginGroup(PDF_EXPORT_SETTINGS_GROUP);

View File

@ -86,6 +86,8 @@
#define SHOW_MARKERS_DEFAULT true #define SHOW_MARKERS_DEFAULT true
#define SHOW_MARKER_INFO_SETTING "markerInfo" #define SHOW_MARKER_INFO_SETTING "markerInfo"
#define SHOW_MARKER_INFO_DEFAULT MarkerInfoItem::None #define SHOW_MARKER_INFO_DEFAULT MarkerInfoItem::None
#define USE_STYLES_SETTING "styles"
#define USE_STYLES_DEFAULT true
#define PDF_EXPORT_SETTINGS_GROUP "Export" #define PDF_EXPORT_SETTINGS_GROUP "Export"
#define PAPER_ORIENTATION_SETTING "orientation" #define PAPER_ORIENTATION_SETTING "orientation"