mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-07 13:03:54 +00:00
[desktop] Removed redundant NightMode setting.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
committed by
Konstantin Pastbin
parent
b195059fb6
commit
905a823490
@@ -152,20 +152,15 @@ namespace qt
|
||||
|
||||
nightModeRadioBox->setLayout(layout);
|
||||
|
||||
int i;
|
||||
if (!settings::Get(settings::kNightMode, i))
|
||||
{
|
||||
i = static_cast<int>(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<NightMode>(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));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user