mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Fixed an issue where two BadgeComponent default values were not always set.
This commit is contained in:
parent
5c7c62b16a
commit
a149124252
|
@ -241,6 +241,7 @@ void BadgeComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
}
|
||||
}
|
||||
|
||||
mFlexboxComponent.setLines(3);
|
||||
if (elem->has("lines")) {
|
||||
const unsigned int lines {elem->get<unsigned int>("lines")};
|
||||
if (lines < 1 || lines > 10) {
|
||||
|
@ -251,10 +252,8 @@ void BadgeComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
mFlexboxComponent.setLines(lines);
|
||||
}
|
||||
}
|
||||
else {
|
||||
mFlexboxComponent.setLines(3);
|
||||
}
|
||||
|
||||
mFlexboxComponent.setItemsPerLine(4);
|
||||
if (elem->has("itemsPerLine")) {
|
||||
const unsigned int itemsPerLine {elem->get<unsigned int>("itemsPerLine")};
|
||||
if (itemsPerLine < 1 || itemsPerLine > 10) {
|
||||
|
@ -266,9 +265,6 @@ void BadgeComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
mFlexboxComponent.setItemsPerLine(itemsPerLine);
|
||||
}
|
||||
}
|
||||
else {
|
||||
mFlexboxComponent.setItemsPerLine(4);
|
||||
}
|
||||
|
||||
if (elem->has("itemMargin")) {
|
||||
glm::vec2 itemMargin = elem->get<glm::vec2>("itemMargin");
|
||||
|
|
Loading…
Reference in a new issue