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:
parent
c1d57b62de
commit
faf0287cf5
@ -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();
|
||||
|
@ -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;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user