Split declaration and implementation of GetSymbol

This commit is contained in:
Lennart Jahn 2024-01-13 14:05:04 +01:00 committed by NeroBurner
parent 264b5bed43
commit 034d83fe6b
3 changed files with 38 additions and 34 deletions

View file

@ -394,6 +394,7 @@ list(APPEND SOURCE_FILES
displayapp/screens/Error.cpp displayapp/screens/Error.cpp
displayapp/screens/Alarm.cpp displayapp/screens/Alarm.cpp
displayapp/screens/Styles.cpp displayapp/screens/Styles.cpp
displayapp/screens/WeatherSymbols.cpp
displayapp/Colors.cpp displayapp/Colors.cpp
displayapp/widgets/Counter.cpp displayapp/widgets/Counter.cpp
displayapp/widgets/PageIndicator.cpp displayapp/widgets/PageIndicator.cpp

View file

@ -0,0 +1,36 @@
#include "displayapp/screens/WeatherSymbols.h"
const char* Pinetime::Applications::Screens::Symbols::GetSymbol(const Pinetime::Controllers::SimpleWeatherService::Icons icon) {
switch (icon) {
case Pinetime::Controllers::SimpleWeatherService::Icons::Sun:
return Symbols::sun;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::CloudsSun:
return Symbols::cloudSun;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::Clouds:
return Symbols::cloud;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::BrokenClouds:
return Symbols::cloudMeatball;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::Thunderstorm:
return Symbols::bolt;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::Snow:
return Symbols::snowflake;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::CloudShowerHeavy:
return Symbols::cloudShowersHeavy;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::CloudSunRain:
return Symbols::cloudSunRain;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::Smog:
return Symbols::smog;
break;
default:
return Symbols::ban;
break;
}
}

View file

@ -6,40 +6,7 @@ namespace Pinetime {
namespace Applications { namespace Applications {
namespace Screens { namespace Screens {
namespace Symbols { namespace Symbols {
const char* GetSymbol(const Pinetime::Controllers::SimpleWeatherService::Icons icon) { const char* GetSymbol(const Pinetime::Controllers::SimpleWeatherService::Icons icon);
switch (icon) {
case Pinetime::Controllers::SimpleWeatherService::Icons::Sun:
return Symbols::sun;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::CloudsSun:
return Symbols::cloudSun;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::Clouds:
return Symbols::cloud;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::BrokenClouds:
return Symbols::cloudMeatball;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::Thunderstorm:
return Symbols::bolt;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::Snow:
return Symbols::snowflake;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::CloudShowerHeavy:
return Symbols::cloudShowersHeavy;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::CloudSunRain:
return Symbols::cloudSunRain;
break;
case Pinetime::Controllers::SimpleWeatherService::Icons::Smog:
return Symbols::smog;
break;
default:
return Symbols::ban;
break;
}
}
} }
} }
} }