GridComponent now sets its default position and size if this is not defined by the theme configuration.

This commit is contained in:
Leon Styhre 2022-11-13 12:25:46 +01:00
parent d14983d4ae
commit 8062ebaf3a

View file

@ -385,7 +385,13 @@ void GridComponent<T>::applyTheme(const std::shared_ptr<ThemeData>& theme,
const std::string& element, const std::string& element,
unsigned int properties) unsigned int properties)
{ {
mSize.x = Renderer::getScreenWidth();
mSize.y = Renderer::getScreenHeight() * 0.8;
GuiComponent::mPosition.x = 0.0f;
GuiComponent::mPosition.y = Renderer::getScreenHeight() * 0.1;
GuiComponent::applyTheme(theme, view, element, properties); GuiComponent::applyTheme(theme, view, element, properties);
using namespace ThemeFlags; using namespace ThemeFlags;
const ThemeData::ThemeElement* elem {theme->getElement(view, element, "grid")}; const ThemeData::ThemeElement* elem {theme->getElement(view, element, "grid")};