mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 18:23:08 +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
|
//reload section icons
|
||||||
vector<string>::size_type i = 0;
|
vector<string>::size_type i = 0;
|
||||||
for (string sectionName : sections) {
|
for (string sectionName : sections) {
|
||||||
string sectionIcon = "sections/" + sectionName + ".png";
|
gmenu2x->sc["skin:sections/" + sectionName + ".png"];
|
||||||
if (!gmenu2x->sc.getSkinFilePath(sectionIcon).empty())
|
|
||||||
gmenu2x->sc.add("skin:" + sectionIcon);
|
|
||||||
|
|
||||||
for (Link *&link : links[i]) {
|
for (Link *&link : links[i]) {
|
||||||
link->loadIcon();
|
link->loadIcon();
|
||||||
|
@ -44,7 +44,6 @@ public:
|
|||||||
|
|
||||||
void debug();
|
void debug();
|
||||||
|
|
||||||
OffscreenSurface *add(const std::string &path);
|
|
||||||
OffscreenSurface *addSkinRes(const std::string &path, bool useDefault = true);
|
OffscreenSurface *addSkinRes(const std::string &path, bool useDefault = true);
|
||||||
void del(const std::string &path);
|
void del(const std::string &path);
|
||||||
void clear();
|
void clear();
|
||||||
@ -55,6 +54,8 @@ public:
|
|||||||
OffscreenSurface *skinRes(const std::string &key, bool useDefault = true);
|
OffscreenSurface *skinRes(const std::string &key, bool useDefault = true);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
OffscreenSurface *add(const std::string &path);
|
||||||
|
|
||||||
SurfaceHash surfaces;
|
SurfaceHash surfaces;
|
||||||
std::string skin;
|
std::string skin;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user