mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
fixed {hasicon} Token in displaymenu header
This commit is contained in:
parent
182a6df2a9
commit
c53e9e3a05
1
HISTORY
1
HISTORY
@ -83,3 +83,4 @@ Version 0.0.5
|
||||
|
||||
- added {channelnumber} and {channelname} Tokens in displaymenudetailepg
|
||||
detailheader
|
||||
- fixed {hasicon} Token in displaymenu header
|
||||
|
@ -267,6 +267,17 @@ string cImageCache::GetIconName(string label, eMenuCategory cat) {
|
||||
return *cString::sprintf("customicons/%s", label.c_str());
|
||||
}
|
||||
|
||||
bool cImageCache::MenuIconExists(string name) {
|
||||
cString iconFullPath = cString::sprintf("%smenuicons/", iconPath.c_str());
|
||||
if (FileExists(*iconFullPath, name, "svg")) {
|
||||
return true;
|
||||
}
|
||||
if (FileExists(*iconFullPath, name, "png")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void cImageCache::CacheSkinpart(string name, int width, int height) {
|
||||
if (width < 1 || width > 1920 || height < 1 || height > 1080)
|
||||
return;
|
||||
|
@ -26,6 +26,7 @@ public:
|
||||
void CacheIcon(eImageType type, string path, int width, int height);
|
||||
cImage *GetIcon(eImageType type, string name, int width, int height);
|
||||
string GetIconName(string label, eMenuCategory cat = mcUndefined);
|
||||
bool MenuIconExists(string name);
|
||||
//skinparts
|
||||
void CacheSkinpart(string path, int width, int height);
|
||||
cImage *GetSkinpart(string name, int width, int height);
|
||||
|
@ -458,7 +458,7 @@ void cDisplayMenuRootView::DrawHeader(void) {
|
||||
bool hasIcon = false;
|
||||
|
||||
string icon = imgCache->GetIconName(menuTitle, cat);
|
||||
if (icon.size() > 0)
|
||||
if (imgCache->MenuIconExists(icon))
|
||||
hasIcon = true;
|
||||
|
||||
stringTokens.insert(pair<string,string>("icon", icon));
|
||||
|
@ -42,7 +42,7 @@ bool cDisplayMenuView::DrawHeader(void) {
|
||||
//check for standard menu entries
|
||||
bool hasIcon = false;
|
||||
string icon = imgCache->GetIconName(menuTitle, cat);
|
||||
if (icon.size() > 0)
|
||||
if (imgCache->MenuIconExists(icon))
|
||||
hasIcon = true;
|
||||
stringTokens.insert(pair<string,string>("icon", icon));
|
||||
intTokens.insert(pair<string,int>("hasicon", hasIcon));
|
||||
|
Loading…
Reference in New Issue
Block a user