Improved some theme warning log messages in CarouselComponent.

This commit is contained in:
Leon Styhre 2022-09-17 18:05:51 +02:00
parent c56b42c756
commit d1d2349c57

View file

@ -695,7 +695,6 @@ template <typename T> void CarouselComponent<T>::render(const glm::mat4& parentT
int belowCenter {static_cast<int>(std::ceil(renderItems.size() / 2)) - 1}; int belowCenter {static_cast<int>(std::ceil(renderItems.size() / 2)) - 1};
// TODO: Fix glitches when navigating to the right.
// The following sorting makes sure that overlapping items are rendered in the correct order. // The following sorting makes sure that overlapping items are rendered in the correct order.
for (int i = 0; i < belowCenter - 0; ++i) for (int i = 0; i < belowCenter - 0; ++i)
renderItemsSorted.emplace_back(renderItems[i]); renderItemsSorted.emplace_back(renderItems[i]);
@ -787,9 +786,9 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
mType = CarouselType::VERTICAL_WHEEL; mType = CarouselType::VERTICAL_WHEEL;
} }
else { else {
LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property " LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property \"type\" "
"<type> defined as \"" "for element \""
<< type << "\""; << element.substr(9) << "\" defined as \"" << type << "\"";
mType = CarouselType::HORIZONTAL; mType = CarouselType::HORIZONTAL;
} }
} }
@ -812,8 +811,8 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
else { else {
mColorGradientHorizontal = true; mColorGradientHorizontal = true;
LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property " LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property "
"<gradientType> defined as \"" "\"gradientType\" for element \""
<< gradientType << "\""; << element.substr(9) << "\" defined as \"" << gradientType << "\"";
} }
} }
@ -834,8 +833,9 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
else { else {
mLinearInterpolation = true; mLinearInterpolation = true;
LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property " LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property "
"<itemInterpolation> defined as \"" "\"itemInterpolation\" for element \""
<< itemInterpolation << "\""; << element.substr(9) << "\" defined as \"" << itemInterpolation
<< "\"";
} }
} }
@ -894,8 +894,8 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
} }
else { else {
LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property " LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property "
"<itemHorizontalAlignment> defined as \"" "\"itemHorizontalAlignment\" for element \""
<< alignment << "\""; << element.substr(9) << "\" defined as \"" << alignment << "\"";
mItemHorizontalAlignment = ALIGN_CENTER; mItemHorizontalAlignment = ALIGN_CENTER;
} }
} }
@ -913,8 +913,8 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
} }
else { else {
LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property " LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property "
"<itemVerticalAlignment> defined as \"" "\"itemVerticalAlignment\" for element \""
<< alignment << "\""; << element.substr(9) << "\" defined as \"" << alignment << "\"";
mItemVerticalAlignment = ALIGN_CENTER; mItemVerticalAlignment = ALIGN_CENTER;
} }
} }
@ -932,8 +932,8 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
} }
else { else {
LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property " LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property "
"<wheelHorizontalAlignment> defined as \"" "\"wheelHorizontalAlignment\" for element \""
<< alignment << "\""; << element.substr(9) << "\" defined as \"" << alignment << "\"";
mWheelHorizontalAlignment = ALIGN_CENTER; mWheelHorizontalAlignment = ALIGN_CENTER;
} }
} }
@ -950,7 +950,9 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
} }
else { else {
LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property " LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property "
"<reflections> only supported for horizontal carousel type"; "\"reflections\" for element \""
<< element.substr(9)
<< "\" only supported for horizontal carousel type";
} }
} }
@ -1020,8 +1022,8 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
} }
else { else {
LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property " LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property "
"<logoAlignment> defined as \"" "\"logoAlignment\" for element \""
<< alignment << "\""; << element.substr(9) << "\" defined as \"" << alignment << "\"";
mItemHorizontalAlignment = ALIGN_CENTER; mItemHorizontalAlignment = ALIGN_CENTER;
mItemVerticalAlignment = ALIGN_CENTER; mItemVerticalAlignment = ALIGN_CENTER;
} }
@ -1064,8 +1066,8 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
} }
else { else {
LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property " LOG(LogWarning) << "CarouselComponent: Invalid theme configuration, property "
"<letterCase> defined as \"" "\"letterCase\" for element \""
<< letterCase << "\""; << element.substr(9) << "\" defined as \"" << letterCase << "\"";
if (hasText) if (hasText)
mText = elem->get<std::string>("text"); mText = elem->get<std::string>("text");
} }