mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-31 04:25:40 +00:00
Changing settings now only invalidates the cached background when necessary.
This commit is contained in:
parent
adc80ca3df
commit
84f4913610
|
@ -84,7 +84,6 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
||||||
setNeedsSaving();
|
setNeedsSaving();
|
||||||
setNeedsReloading();
|
setNeedsReloading();
|
||||||
setNeedsCollectionsUpdate();
|
setNeedsCollectionsUpdate();
|
||||||
setDoNotInvalidateCachedBackground();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -138,7 +137,6 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
||||||
setNeedsReloading();
|
setNeedsReloading();
|
||||||
setNeedsCollectionsUpdate();
|
setNeedsCollectionsUpdate();
|
||||||
setNeedsGoToGroupedCollections();
|
setNeedsGoToGroupedCollections();
|
||||||
setDoNotInvalidateCachedBackground();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -293,6 +291,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
||||||
setNeedsReloading();
|
setNeedsReloading();
|
||||||
setNeedsSorting();
|
setNeedsSorting();
|
||||||
setNeedsSortingCollections();
|
setNeedsSortingCollections();
|
||||||
|
setInvalidateCachedBackground();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -305,6 +304,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
||||||
Settings::getInstance()->setBool("FavStarCustom", fav_star_custom->getState());
|
Settings::getInstance()->setBool("FavStarCustom", fav_star_custom->getState());
|
||||||
setNeedsSaving();
|
setNeedsSaving();
|
||||||
setNeedsReloading();
|
setNeedsReloading();
|
||||||
|
setInvalidateCachedBackground();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -324,6 +324,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
||||||
setNeedsCollectionsUpdate();
|
setNeedsCollectionsUpdate();
|
||||||
setNeedsReloading();
|
setNeedsReloading();
|
||||||
setNeedsGoToSystem(SystemData::sSystemVector.front());
|
setNeedsGoToSystem(SystemData::sSystemVector.front());
|
||||||
|
setInvalidateCachedBackground();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -339,6 +340,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(
|
||||||
collection_show_system_info->getState());
|
collection_show_system_info->getState());
|
||||||
setNeedsSaving();
|
setNeedsSaving();
|
||||||
setNeedsReloading();
|
setNeedsReloading();
|
||||||
|
setInvalidateCachedBackground();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -148,6 +148,7 @@ void GuiMenu::openUISettings()
|
||||||
gamelist_view_style->getSelected());
|
gamelist_view_style->getSelected());
|
||||||
s->setNeedsSaving();
|
s->setNeedsSaving();
|
||||||
s->setNeedsReloading();
|
s->setNeedsReloading();
|
||||||
|
s->setInvalidateCachedBackground();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -190,6 +191,7 @@ void GuiMenu::openUISettings()
|
||||||
Settings::getInstance()->setString("ThemeSet", theme_set->getSelected());
|
Settings::getInstance()->setString("ThemeSet", theme_set->getSelected());
|
||||||
s->setNeedsSaving();
|
s->setNeedsSaving();
|
||||||
s->setNeedsReloading();
|
s->setNeedsReloading();
|
||||||
|
s->setInvalidateCachedBackground();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -273,6 +275,7 @@ void GuiMenu::openUISettings()
|
||||||
s->setNeedsResetFilters();
|
s->setNeedsResetFilters();
|
||||||
s->setNeedsReloading();
|
s->setNeedsReloading();
|
||||||
s->setNeedsGoToSystem(SystemData::sSystemVector.front());
|
s->setNeedsGoToSystem(SystemData::sSystemVector.front());
|
||||||
|
s->setInvalidateCachedBackground();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -309,6 +312,7 @@ void GuiMenu::openUISettings()
|
||||||
s->setNeedsSaving();
|
s->setNeedsSaving();
|
||||||
s->setNeedsSorting();
|
s->setNeedsSorting();
|
||||||
s->setNeedsSortingCollections();
|
s->setNeedsSortingCollections();
|
||||||
|
s->setInvalidateCachedBackground();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -343,6 +347,7 @@ void GuiMenu::openUISettings()
|
||||||
Settings::getInstance()->setBool("MenuBlurBackground",
|
Settings::getInstance()->setBool("MenuBlurBackground",
|
||||||
menu_blur_background->getState());
|
menu_blur_background->getState());
|
||||||
s->setNeedsSaving();
|
s->setNeedsSaving();
|
||||||
|
s->setInvalidateCachedBackground();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
@ -385,6 +390,7 @@ void GuiMenu::openUISettings()
|
||||||
Settings::getInstance()->setBool("FoldersOnTop", folders_on_top->getState());
|
Settings::getInstance()->setBool("FoldersOnTop", folders_on_top->getState());
|
||||||
s->setNeedsSaving();
|
s->setNeedsSaving();
|
||||||
s->setNeedsSorting();
|
s->setNeedsSorting();
|
||||||
|
s->setInvalidateCachedBackground();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -399,6 +405,7 @@ void GuiMenu::openUISettings()
|
||||||
s->setNeedsSaving();
|
s->setNeedsSaving();
|
||||||
s->setNeedsSorting();
|
s->setNeedsSorting();
|
||||||
s->setNeedsSortingCollections();
|
s->setNeedsSortingCollections();
|
||||||
|
s->setInvalidateCachedBackground();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -411,6 +418,7 @@ void GuiMenu::openUISettings()
|
||||||
Settings::getInstance()->setBool("FavoritesStar", favorites_star->getState());
|
Settings::getInstance()->setBool("FavoritesStar", favorites_star->getState());
|
||||||
s->setNeedsSaving();
|
s->setNeedsSaving();
|
||||||
s->setNeedsReloading();
|
s->setNeedsReloading();
|
||||||
|
s->setInvalidateCachedBackground();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -940,6 +948,7 @@ void GuiMenu::openOtherSettings()
|
||||||
Settings::getInstance()->setBool("ROMDirGameMedia", rom_dir_game_media->getState());
|
Settings::getInstance()->setBool("ROMDirGameMedia", rom_dir_game_media->getState());
|
||||||
s->setNeedsSaving();
|
s->setNeedsSaving();
|
||||||
s->setNeedsReloading();
|
s->setNeedsReloading();
|
||||||
|
s->setInvalidateCachedBackground();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ GuiSettings::GuiSettings(
|
||||||
mNeedsGoToStart(false),
|
mNeedsGoToStart(false),
|
||||||
mNeedsGoToSystem(false),
|
mNeedsGoToSystem(false),
|
||||||
mNeedsGoToGroupedCollections(false),
|
mNeedsGoToGroupedCollections(false),
|
||||||
mDoNotInvalidateCachedBackground(false),
|
mInvalidateCachedBackground(false),
|
||||||
mGoToSystem(nullptr)
|
mGoToSystem(nullptr)
|
||||||
{
|
{
|
||||||
addChild(&mMenu);
|
addChild(&mMenu);
|
||||||
|
@ -135,7 +135,7 @@ void GuiSettings::save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mDoNotInvalidateCachedBackground) {
|
if (mInvalidateCachedBackground) {
|
||||||
// This delay reduces the likelyhood that the SVG rasterizer which is running in a
|
// This delay reduces the likelyhood that the SVG rasterizer which is running in a
|
||||||
// separate thread is not done until the cached background is invalidated. Without
|
// separate thread is not done until the cached background is invalidated. Without
|
||||||
// this delay there's a high chance that some theme elements are not rendered in
|
// this delay there's a high chance that some theme elements are not rendered in
|
||||||
|
|
|
@ -43,7 +43,7 @@ public:
|
||||||
void setNeedsGoToSystem(SystemData* goToSystem)
|
void setNeedsGoToSystem(SystemData* goToSystem)
|
||||||
{ mNeedsGoToSystem = true; mGoToSystem = goToSystem; };
|
{ mNeedsGoToSystem = true; mGoToSystem = goToSystem; };
|
||||||
void setNeedsGoToGroupedCollections() { mNeedsGoToGroupedCollections = true; };
|
void setNeedsGoToGroupedCollections() { mNeedsGoToGroupedCollections = true; };
|
||||||
void setDoNotInvalidateCachedBackground() { mDoNotInvalidateCachedBackground = true; };
|
void setInvalidateCachedBackground() { mInvalidateCachedBackground = true; };
|
||||||
|
|
||||||
bool input(InputConfig* config, Input input) override;
|
bool input(InputConfig* config, Input input) override;
|
||||||
std::vector<HelpPrompt> getHelpPrompts() override;
|
std::vector<HelpPrompt> getHelpPrompts() override;
|
||||||
|
@ -61,7 +61,7 @@ private:
|
||||||
bool mNeedsGoToStart;
|
bool mNeedsGoToStart;
|
||||||
bool mNeedsGoToSystem;
|
bool mNeedsGoToSystem;
|
||||||
bool mNeedsGoToGroupedCollections;
|
bool mNeedsGoToGroupedCollections;
|
||||||
bool mDoNotInvalidateCachedBackground;
|
bool mInvalidateCachedBackground;
|
||||||
|
|
||||||
SystemData* mGoToSystem;
|
SystemData* mGoToSystem;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue