diff --git a/platform/settings.cpp b/platform/settings.cpp index 15fd38910..3d1fdf8f9 100644 --- a/platform/settings.cpp +++ b/platform/settings.cpp @@ -23,7 +23,6 @@ using namespace std; std::string_view kMeasurementUnits = "Units"; std::string_view kMapLanguageCode = "MapLanguageCode"; std::string_view kDeveloperMode = "DeveloperMode"; -std::string_view kNightMode = "NightMode"; std::string_view kDonateUrl = "DonateUrl"; std::string_view kNY = "NY"; diff --git a/platform/settings.hpp b/platform/settings.hpp index fd45e2b7f..6dec4fb33 100644 --- a/platform/settings.hpp +++ b/platform/settings.hpp @@ -12,7 +12,6 @@ namespace settings extern std::string_view kMeasurementUnits; extern std::string_view kDeveloperMode; extern std::string_view kMapLanguageCode; -extern std::string_view kNightMode; // The following two settings are configured externally at the metaserver. extern std::string_view kDonateUrl; extern std::string_view kNY; diff --git a/qt/preferences_dialog.cpp b/qt/preferences_dialog.cpp index acc0fa827..27a394a02 100644 --- a/qt/preferences_dialog.cpp +++ b/qt/preferences_dialog.cpp @@ -152,20 +152,15 @@ namespace qt nightModeRadioBox->setLayout(layout); - int i; - if (!settings::Get(settings::kNightMode, i)) - { - i = static_cast(MapStyleIsDark(framework.GetMapStyle()) ? NightMode::On : NightMode::Off); - settings::Set(settings::kNightMode, i); - } - nightModeGroup->button(i)->setChecked(true); + int const btn = MapStyleIsDark(framework.GetMapStyle()) ? 1 : 0; + nightModeGroup->button(btn)->setChecked(true); void (QButtonGroup::* buttonClicked)(int) = &QButtonGroup::idClicked; connect(nightModeGroup, buttonClicked, [&framework](int i) { - NightMode nightMode = static_cast(i); - settings::Set(settings::kNightMode, i); - framework.SetMapStyle((nightMode == NightMode::Off) ? GetLightMapStyleVariant(framework.GetMapStyle()) : GetDarkMapStyleVariant(framework.GetMapStyle())); + auto const currStyle = framework.GetMapStyle(); + framework.SetMapStyle((i == 0) ? GetLightMapStyleVariant(currStyle) : + GetDarkMapStyleVariant(currStyle)); }); }