mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-29 17:45:38 +00:00
Merge branch '63-add-badges-decals-e-g-for-favorites-completed-games-non-working-games-collections-and-folders' into 575-theme-add-a-modern-clean-switch-like-theme-as-an-official-theme-in-es-de-to-choose-from
This commit is contained in:
commit
2bd3d03ca9
|
@ -20,8 +20,9 @@ class VideoComponent;
|
|||
class VideoGameListView : public BasicGameListView
|
||||
{
|
||||
public:
|
||||
VideoGameListView(Window* window, FileData* root);
|
||||
virtual ~VideoGameListView();
|
||||
VideoGameListView(Window *window, FileData *root);
|
||||
|
||||
virtual ~VideoGameListView() noexcept;
|
||||
|
||||
virtual void onShow() override;
|
||||
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;
|
||||
|
|
|
@ -18,6 +18,7 @@ const std::vector<std::string> BadgesComponent::mSlots = {SLOT_FAVORITE, SLOT_CO
|
|||
SLOT_ALTERNATIVE_EMULATOR};
|
||||
std::map<std::string, std::string> BadgesComponent::mBadgeIcons = std::map<std::string, std::string>();
|
||||
std::map<std::string, ImageComponent> BadgesComponent::mImageComponents = std::map<std::string, ImageComponent>();
|
||||
std::vector<BadgesComponent *> BadgesComponent::mInstances = {};
|
||||
|
||||
BadgesComponent::BadgesComponent(Window *window)
|
||||
: FlexboxComponent(window) {
|
||||
|
@ -48,12 +49,19 @@ BadgesComponent::BadgesComponent(Window *window)
|
|||
mImageAltEmu.setImage(mBadgeIcons[SLOT_ALTERNATIVE_EMULATOR], false, true);
|
||||
mImageComponents.insert({SLOT_ALTERNATIVE_EMULATOR, mImageAltEmu});
|
||||
}
|
||||
|
||||
mInstances.push_back(this);
|
||||
}
|
||||
|
||||
BadgesComponent::~BadgesComponent() {
|
||||
mChildren.clear();
|
||||
BadgesComponent::~BadgesComponent() noexcept {
|
||||
for (GuiComponent *c: mChildren)
|
||||
c->clearChildren();
|
||||
clearChildren();
|
||||
mInstances.erase(std::remove(mInstances.begin(), mInstances.end(), this), mInstances.end());
|
||||
if (mInstances.empty()) {
|
||||
mBadgeIcons.clear();
|
||||
mImageComponents.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ class BadgesComponent : public FlexboxComponent
|
|||
{
|
||||
public:
|
||||
BadgesComponent(Window *window);
|
||||
|
||||
~BadgesComponent() noexcept;
|
||||
|
||||
std::string getValue() const override;
|
||||
|
@ -46,6 +45,7 @@ private:
|
|||
static const std::vector<std::string> mSlots;
|
||||
static std::map<std::string, std::string> mBadgeIcons;
|
||||
static std::map<std::string, ImageComponent> mImageComponents;
|
||||
static std::vector<BadgesComponent *> mInstances;
|
||||
};
|
||||
|
||||
#endif // ES_APP_COMPONENTS_BADGES_COMPONENT_H
|
||||
|
|
Loading…
Reference in a new issue