mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-04-10 19:15:13 +00:00
Added support for a 'none' value to the helpsystem element scope property
This commit is contained in:
parent
4a002d4fb3
commit
c1cfc02942
|
@ -352,6 +352,8 @@ void GamelistView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
|
|||
else if (element.second.type == "helpsystem") {
|
||||
mHelpComponents.emplace_back(std::make_unique<HelpComponent>());
|
||||
mHelpComponents.back()->applyTheme(theme, "gamelist", element.first, ALL);
|
||||
if (mHelpComponents.back()->getHelpComponentScope() == HelpComponentScope::NONE)
|
||||
mHelpComponents.pop_back();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -726,6 +726,10 @@ void SystemView::populate()
|
|||
elements.helpComponents.emplace_back(std::make_unique<HelpComponent>());
|
||||
elements.helpComponents.back()->applyTheme(theme, "system", element.first,
|
||||
ThemeFlags::ALL);
|
||||
if (elements.helpComponents.back()->getHelpComponentScope() ==
|
||||
HelpComponentScope::NONE) {
|
||||
elements.helpComponents.pop_back();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,8 @@ enum class Stationary {
|
|||
enum class HelpComponentScope {
|
||||
SHARED,
|
||||
VIEW,
|
||||
MENU
|
||||
MENU,
|
||||
NONE
|
||||
};
|
||||
|
||||
class GuiComponent
|
||||
|
|
|
@ -270,6 +270,11 @@ void HelpComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
if (!elem)
|
||||
return;
|
||||
|
||||
if (elem->has("scope") && elem->get<std::string>("scope") == "none") {
|
||||
mHelpComponentScope = HelpComponentScope::NONE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (elem->has("pos"))
|
||||
mStylePosition = elem->get<glm::vec2>("pos") *
|
||||
glm::vec2 {Renderer::getScreenWidth(), Renderer::getScreenHeight()};
|
||||
|
|
Loading…
Reference in a new issue