1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-25 18:05:20 +02:00

Simplify code to reload section icons when skin changes

This commit is contained in:
Maarten ter Huurne 2014-08-15 16:54:30 +02:00
parent c1d57b62de
commit faf0287cf5
2 changed files with 3 additions and 4 deletions

View File

@ -140,9 +140,7 @@ void Menu::skinUpdated() {
//reload section icons
vector<string>::size_type i = 0;
for (string sectionName : sections) {
string sectionIcon = "sections/" + sectionName + ".png";
if (!gmenu2x->sc.getSkinFilePath(sectionIcon).empty())
gmenu2x->sc.add("skin:" + sectionIcon);
gmenu2x->sc["skin:sections/" + sectionName + ".png"];
for (Link *&link : links[i]) {
link->loadIcon();

View File

@ -44,7 +44,6 @@ public:
void debug();
OffscreenSurface *add(const std::string &path);
OffscreenSurface *addSkinRes(const std::string &path, bool useDefault = true);
void del(const std::string &path);
void clear();
@ -55,6 +54,8 @@ public:
OffscreenSurface *skinRes(const std::string &key, bool useDefault = true);
private:
OffscreenSurface *add(const std::string &path);
SurfaceHash surfaces;
std::string skin;
};