Fixed an issue where a black screen would sometimes be shown when enabling collections.

This commit is contained in:
Leon Styhre 2021-03-12 20:36:38 +01:00
parent 37e8e71adf
commit 03fec8b74d
3 changed files with 10 additions and 3 deletions

View file

@ -84,6 +84,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
setNeedsSaving();
setNeedsReloading();
setNeedsCollectionsUpdate();
setDoNotInvalidateCachedBackground();
}
});
@ -137,6 +138,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
setNeedsReloading();
setNeedsCollectionsUpdate();
setNeedsGoToGroupedCollections();
setDoNotInvalidateCachedBackground();
}
}
});

View file

@ -33,6 +33,7 @@ GuiSettings::GuiSettings(
mNeedsGoToStart(false),
mNeedsGoToSystem(false),
mNeedsGoToGroupedCollections(false),
mDoNotInvalidateCachedBackground(false),
mGoToSystem(nullptr)
{
addChild(&mMenu);
@ -134,9 +135,11 @@ void GuiSettings::save()
}
}
if (!mDoNotInvalidateCachedBackground) {
if (mNeedsSaving || mNeedsCollectionsUpdate || mNeedsReloading || mNeedsSorting ||
mNeedsGoToStart || mNeedsGoToSystem)
mWindow->invalidateCachedBackground();
}
}
void GuiSettings::addEditableTextComponent(

View file

@ -43,6 +43,7 @@ public:
void setNeedsGoToSystem(SystemData* goToSystem)
{ mNeedsGoToSystem = true; mGoToSystem = goToSystem; };
void setNeedsGoToGroupedCollections() { mNeedsGoToGroupedCollections = true; };
void setDoNotInvalidateCachedBackground() { mDoNotInvalidateCachedBackground = true; };
bool input(InputConfig* config, Input input) override;
std::vector<HelpPrompt> getHelpPrompts() override;
@ -60,6 +61,7 @@ private:
bool mNeedsGoToStart;
bool mNeedsGoToSystem;
bool mNeedsGoToGroupedCollections;
bool mDoNotInvalidateCachedBackground;
SystemData* mGoToSystem;
};