Fixed an issue where a default primary component was not set in GamelistView.

This commit is contained in:
Leon Styhre 2022-03-25 21:50:50 +01:00
parent db72d41ef0
commit b96f6bc131

View file

@ -245,24 +245,25 @@ void GamelistView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
} }
} }
if (mPrimary == nullptr) {
mTextList = std::make_unique<TextListComponent<FileData*>>();
mPrimary = mTextList.get();
mPrimary->setPosition(0.2f, mSize.y * 0.2f);
mPrimary->setSize(mSize.x * 0.7f, mSize.y * 0.6f);
mPrimary->setAlignment(TextListComponent<FileData*>::PrimaryAlignment::ALIGN_LEFT);
mPrimary->setCursorChangedCallback(
[&](const CursorState& state) { updateInfoPanel(state); });
mPrimary->setDefaultZIndex(50.0f);
mPrimary->setZIndex(50.0f);
mPrimary->applyTheme(theme, "gamelist", "", ALL);
addChild(mPrimary);
}
mHelpStyle.applyTheme(mTheme, "gamelist"); mHelpStyle.applyTheme(mTheme, "gamelist");
populateList(mRoot->getChildrenListToDisplay(), mRoot);
} }
if (mPrimary == nullptr) {
mTextList = std::make_unique<TextListComponent<FileData*>>();
mPrimary = mTextList.get();
mPrimary->setPosition(0.2f, mSize.y * 0.2f);
mPrimary->setSize(mSize.x * 0.7f, mSize.y * 0.6f);
mPrimary->setAlignment(TextListComponent<FileData*>::PrimaryAlignment::ALIGN_LEFT);
mPrimary->setCursorChangedCallback(
[&](const CursorState& state) { updateInfoPanel(state); });
mPrimary->setDefaultZIndex(50.0f);
mPrimary->setZIndex(50.0f);
mPrimary->applyTheme(theme, "gamelist", "", ALL);
addChild(mPrimary);
}
populateList(mRoot->getChildrenListToDisplay(), mRoot);
// Disable quick system select if the primary component uses the left and right buttons. // Disable quick system select if the primary component uses the left and right buttons.
if (mCarousel != nullptr) { if (mCarousel != nullptr) {
if (mCarousel->getType() == CarouselComponent<FileData*>::CarouselType::HORIZONTAL || if (mCarousel->getType() == CarouselComponent<FileData*>::CarouselType::HORIZONTAL ||