mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 15:15:37 +00:00
Fixed a potential crash due to the filter menu entry being displayed when it shouldn't.
Also some very minor code cleanup.
This commit is contained in:
parent
9738957253
commit
4ca11e7062
|
@ -50,7 +50,7 @@ void GuiGamelistFilter::initializeMenu()
|
|||
|
||||
mMenu.addButton("BACK", "back", std::bind(&GuiGamelistFilter::applyFilters, this));
|
||||
|
||||
mMenu.setPosition((Renderer::getScreenWidth() - mMenu.getSize().x()) / 2,
|
||||
mMenu.setPosition((Renderer::getScreenWidth() - mMenu.getSize().x()) / 2.0f,
|
||||
Renderer::getScreenHeight() * 0.15f);
|
||||
|
||||
// Save the initial filter values to be able to check later if any changes were made.
|
||||
|
|
|
@ -141,8 +141,9 @@ GuiGamelistOptions::GuiGamelistOptions(
|
|||
}
|
||||
}
|
||||
|
||||
// Add the filters entry, unless this is the grouped custom collections list.
|
||||
if (!mIsCustomCollectionGroup) {
|
||||
// Add the filters entry, unless this is the grouped custom collections system or if there
|
||||
// are no games (which should only happen for ungrouped custom collections).
|
||||
if (!mIsCustomCollectionGroup && system->getRootFolder()->getChildren().size() > 0) {
|
||||
if (system->getName() != "recent" && Settings::getInstance()->getBool("GamelistFilters")) {
|
||||
row.elements.clear();
|
||||
row.addElement(std::make_shared<TextComponent>
|
||||
|
@ -212,8 +213,8 @@ GuiGamelistOptions::GuiGamelistOptions(
|
|||
// Center the menu.
|
||||
setSize(static_cast<float>(Renderer::getScreenWidth()),
|
||||
static_cast<float>(Renderer::getScreenHeight()));
|
||||
mMenu.setPosition((mSize.x() - mMenu.getSize().x()) / 2, (mSize.y() -
|
||||
mMenu.getSize().y()) / 2);
|
||||
mMenu.setPosition((mSize.x() - mMenu.getSize().x()) / 2.0f, (mSize.y() -
|
||||
mMenu.getSize().y()) / 2.0f);
|
||||
}
|
||||
|
||||
GuiGamelistOptions::~GuiGamelistOptions()
|
||||
|
|
Loading…
Reference in a new issue