Changed a value for the itemTransitions property for the carousel and grid components.

Also changed the position of a grid property and set the minimum columns value to 1.
This commit is contained in:
Leon Styhre 2022-11-13 23:04:48 +01:00
parent 9013faf445
commit be903c0a86
3 changed files with 4 additions and 4 deletions

View file

@ -160,8 +160,8 @@ std::map<std::string, std::map<std::string, ThemeData::ElementPropertyType>>
{"defaultItem", PATH}, {"defaultItem", PATH},
{"itemSize", NORMALIZED_PAIR}, {"itemSize", NORMALIZED_PAIR},
{"itemScale", FLOAT}, {"itemScale", FLOAT},
{"itemSpacing", NORMALIZED_PAIR},
{"itemTransitions", STRING}, {"itemTransitions", STRING},
{"itemSpacing", NORMALIZED_PAIR},
{"itemHorizontalAlignment", STRING}, {"itemHorizontalAlignment", STRING},
{"itemVerticalAlignment", STRING}, {"itemVerticalAlignment", STRING},
{"horizontalOffset", FLOAT}, {"horizontalOffset", FLOAT},

View file

@ -1010,7 +1010,7 @@ void CarouselComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
if (elem->has("itemTransitions")) { if (elem->has("itemTransitions")) {
const std::string& itemTransitions {elem->get<std::string>("itemTransitions")}; const std::string& itemTransitions {elem->get<std::string>("itemTransitions")};
if (itemTransitions == "slide") { if (itemTransitions == "animate") {
mInstantItemTransitions = false; mInstantItemTransitions = false;
} }
else if (itemTransitions == "instant") { else if (itemTransitions == "instant") {

View file

@ -434,7 +434,7 @@ void GridComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
return; return;
if (elem->has("columns")) if (elem->has("columns"))
mColumns = glm::clamp(elem->get<unsigned int>("columns"), 0u, 100u); mColumns = glm::clamp(elem->get<unsigned int>("columns"), 1u, 100u);
if (elem->has("itemSize")) { if (elem->has("itemSize")) {
const glm::vec2& itemSize {glm::clamp(elem->get<glm::vec2>("itemSize"), 0.05f, 1.0f)}; const glm::vec2& itemSize {glm::clamp(elem->get<glm::vec2>("itemSize"), 0.05f, 1.0f)};
@ -446,7 +446,7 @@ void GridComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
if (elem->has("itemTransitions")) { if (elem->has("itemTransitions")) {
const std::string& itemTransitions {elem->get<std::string>("itemTransitions")}; const std::string& itemTransitions {elem->get<std::string>("itemTransitions")};
if (itemTransitions == "scale") { if (itemTransitions == "animate") {
mInstantItemTransitions = false; mInstantItemTransitions = false;
} }
else if (itemTransitions == "instant") { else if (itemTransitions == "instant") {