Commit 86d4d341 authored by Volker Krause's avatar Volker Krause

Provide weather symbol icon names

parent df0d0ab1
......@@ -51,6 +51,29 @@ if (ANDROID)
settings-configure
view-calendar-day
view-refresh
weather-clear
weather-clear-night
weather-few-clouds
weather-few-clouds-night
weather-clouds
weather-clouds-night
weather-showers-day
weather-showers-night
weather-showers-scattered-day
weather-showers-scattered-night
weather-snow-scattered-day
weather-snow-scattered-night
weather-storm-day
weather-storm-night
weather-many-clouds
weather-fog
weather-showers
weather-showers-scattered
weather-hail
weather-snow
weather-snow-scattered
weather-storm
)
else ()
target_link_libraries(itinerary-app PRIVATE Qt5::Positioning)
......
......@@ -75,7 +75,28 @@ void WeatherForecast::setSymbolType(WeatherForecast::SymbolType type)
QString WeatherForecast::symbolIconName() const
{
return {}; // TODO map to breeze icons and determine day/night version
// TODO night icon handling
switch (symbolType()) {
case Unknown: return {};
case Clear: return QStringLiteral("weather-clear");
case LightClouds: return QStringLiteral("weather-few-clouds");
case PartlyCloudy: return QStringLiteral("weather-clouds");
case RainShowers: return QStringLiteral("weather-showers-day");
case LightRainShowers: return QStringLiteral("weather-showers-scattered-day");
case LightSnowShowers: return QStringLiteral("weather-snow-scattered-day");
case ThunderStormShowers: return QStringLiteral("weather-storm-day");
// ^ have day and night variants
// v only universal variants
case Clouds: return QStringLiteral("weather-many-clouds");
case Fog: return QStringLiteral("weather-fog");
case Rain: return QStringLiteral("weather-showers");
case LightRain: return QStringLiteral("weather-showers-scattered");
case Hail: return QStringLiteral("weather-hail");
case Snow: return QStringLiteral("weather-snow");
case LightSnow: return QStringLiteral("weather-snow-scattered");
case ThunderStorm: return QStringLiteral("weather-storm");
}
return {};
}
void WeatherForecast::merge(WeatherForecast &other)
......
......@@ -31,6 +31,10 @@ class WeatherForecastPrivate;
class WeatherForecast
{
Q_GADGET
Q_PROPERTY(bool valid READ isValid CONSTANT)
Q_PROPERTY(float temperature READ temperature CONSTANT)
Q_PROPERTY(QString symbolIconName READ symbolIconName CONSTANT)
public:
/** Weather symbol, aligned with the Breeze icon theme, not the data source symbols. */
enum SymbolType : uint8_t {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment