Fix review comments

Signed-off-by: Ferenc Géczi <ferenc.gm@gmail.com>
This commit is contained in:
Ferenc Géczi 2024-12-15 00:00:00 +00:00 committed by Konstantin Pastbin
parent 1a5def70b5
commit 8d2d8d3c80
2 changed files with 9 additions and 5 deletions

View file

@ -57,6 +57,10 @@ std::string DebugPrint(MapStyle mapStyle)
bool MapStyleIsDark(MapStyle mapStyle)
{
const std::unordered_set<MapStyle> darkStyles {MapStyle::MapStyleDefaultDark, MapStyle::MapStyleVehicleDark, MapStyle::MapStyleOutdoorsDark};
return darkStyles.contains(mapStyle);
for (const auto darkStyle : {MapStyleDefaultDark, MapStyleVehicleDark, MapStyleOutdoorsDark})
{
if (mapStyle == darkStyle)
return true;
}
return false;
}

View file

@ -770,19 +770,19 @@ void DrawWidget::RefreshDrawingRules()
void DrawWidget::SetMapStyleToDefault()
{
auto style = m_framework.GetMapStyle();
auto const style = m_framework.GetMapStyle();
SetMapStyle(MapStyleIsDark(style) ? MapStyle::MapStyleDefaultDark : MapStyle::MapStyleDefaultLight);
}
void DrawWidget::SetMapStyleToVehicle()
{
auto style = m_framework.GetMapStyle();
auto const style = m_framework.GetMapStyle();
SetMapStyle(MapStyleIsDark(style) ? MapStyle::MapStyleVehicleDark : MapStyle::MapStyleVehicleLight);
}
void DrawWidget::SetMapStyleToOutdoors()
{
auto style = m_framework.GetMapStyle();
auto const style = m_framework.GetMapStyle();
SetMapStyle(MapStyleIsDark(style) ? MapStyle::MapStyleOutdoorsDark : MapStyle::MapStyleOutdoorsLight);
}