summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY2
-rw-r--r--Makefile2
-rw-r--r--libcore/imagecache.c41
-rw-r--r--libcore/imagecache.h2
-rw-r--r--skins/metrixhd/xmlfiles/displaymenuschedules.xml5
-rw-r--r--skins/metrixhd/xmlfiles/displaymenusetup.xml4
-rw-r--r--skinskeleton/xmlfiles/displaymenuschedules.xml2
-rw-r--r--views/displaymenurootview.c7
-rw-r--r--views/displaymenurootview.h1
-rw-r--r--views/displaymenuview.c9
10 files changed, 67 insertions, 8 deletions
diff --git a/HISTORY b/HISTORY
index 1a648c7..3c653db 100644
--- a/HISTORY
+++ b/HISTORY
@@ -35,6 +35,8 @@ Version 0.0.2
- implemented function drawslope, see Wiki for documentation
- using default menu list in case an invalid MenuCategory is set
- added device info in displaychannel, example in metrixHD
+- improved menu icon display, additionally using menu cat
+
diff --git a/Makefile b/Makefile
index 549b9b6..2be7976 100644
--- a/Makefile
+++ b/Makefile
@@ -90,7 +90,7 @@ OBJS = $(PLUGIN).o \
libtemplate/templateloopfunction.o \
libtemplate/xmlparser.o \
views/view.o \
- views/viewhelpers.o \
+ views/viewhelpers.o \
views/displaychannelview.o \
views/displaymenurootview.o \
views/displaymenuview.o \
diff --git a/libcore/imagecache.c b/libcore/imagecache.c
index 101c8b8..9ad9918 100644
--- a/libcore/imagecache.c
+++ b/libcore/imagecache.c
@@ -199,7 +199,46 @@ cImage *cImageCache::GetIcon(eImageType type, string name, int width, int height
return NULL;
}
-string cImageCache::GetIconName(string label) {
+string cImageCache::GetIconName(string label, eMenuCategory cat) {
+ //if cat is set, use standard menu entries
+ switch (cat) {
+ case mcSchedule:
+ case mcScheduleNow:
+ case mcScheduleNext:
+ case mcEvent:
+ return "standardicons/Schedule";
+ case mcChannel:
+ case mcChannelEdit:
+ return "standardicons/Channels";
+ case mcTimer:
+ case mcTimerEdit:
+ return "standardicons/Timers";
+ case mcRecording:
+ case mcRecordingInfo:
+ case mcSetupRecord:
+ case mcSetupReplay:
+ return "standardicons/Recordings";
+ case mcPlugin:
+ case mcPluginSetup:
+ case mcSetupPlugins:
+ return "standardicons/Plugins";
+ case mcSetup:
+ return "standardicons/Setup";
+ case mcSetupOsd:
+ return "standardicons/OSD";
+ case mcSetupEpg:
+ return "standardicons/EPG";
+ case mcSetupDvb:
+ return "standardicons/DVB";
+ case mcSetupLnb:
+ return "standardicons/LNB";
+ case mcSetupCam:
+ return "standardicons/CAM";
+ case mcSetupMisc:
+ return "standardicons/Miscellaneous";
+ case mcCommand:
+ return "standardicons/Commands";
+ }
//check for standard menu entries
for (int i=0; i<16; i++) {
string s = trVDR(items[i].c_str());
diff --git a/libcore/imagecache.h b/libcore/imagecache.h
index a0264d8..db56a67 100644
--- a/libcore/imagecache.h
+++ b/libcore/imagecache.h
@@ -28,7 +28,7 @@ public:
//icons
void CacheIcon(eImageType type, string path, int width, int height);
cImage *GetIcon(eImageType type, string name, int width, int height);
- string GetIconName(string label);
+ string GetIconName(string label, eMenuCategory cat = mcUndefined);
//skinparts
void CacheSkinpart(string path, int width, int height);
cImage *GetSkinpart(string name, int width, int height);
diff --git a/skins/metrixhd/xmlfiles/displaymenuschedules.xml b/skins/metrixhd/xmlfiles/displaymenuschedules.xml
index 95f8174..b28471e 100644
--- a/skins/metrixhd/xmlfiles/displaymenuschedules.xml
+++ b/skins/metrixhd/xmlfiles/displaymenuschedules.xml
@@ -2,6 +2,8 @@
<!-- Available Variables header:
{title} title of current menu
{vdrversion} running VDR Version
+ {hasicon} true if a menu icon is available
+ {icon} path of menu icon
{channelnumber} Number of Channel of current event
{channelname} Name of current Channel of current event
{channellogoexists} true if a channel logo exists
@@ -12,7 +14,8 @@
-->
<header>
<area x="0" y="0" width="38%" height="10%" layer="2">
- <drawtext condition="{whatsonnow}||{whatsonnext}" x="5" valign="center" font="{light}" fontsize="80%" color="{clrWhite}" text="{title}" />
+ <drawimage condition="{whatsonnow}||{whatsonnext}" name="menuicon" imagetype="menuicon" path="{icon}" x="5" valign="center" width="{areaheight}*8/10" height="80%"/>
+ <drawtext condition="{whatsonnow}||{whatsonnext}" x="{width(menuicon)} + 15" valign="center" font="{light}" fontsize="80%" color="{clrWhite}" text="{title}" />
<drawimage name="logo" condition="{whatson}" imagetype="channellogo" path="{channelid}" x="0" height="100%" align="left" valign="center" />
<drawtext condition="{whatson}" x="{width(logo)}+20" valign="center" font="{light}" fontsize="80%" color="{clrWhite}" text="{channelnumber} - {channelname}" />
</area>
diff --git a/skins/metrixhd/xmlfiles/displaymenusetup.xml b/skins/metrixhd/xmlfiles/displaymenusetup.xml
index d8d1852..d2fc400 100644
--- a/skins/metrixhd/xmlfiles/displaymenusetup.xml
+++ b/skins/metrixhd/xmlfiles/displaymenusetup.xml
@@ -13,10 +13,12 @@
<!-- Available Variables header:
{title} title of current menu
{vdrversion} running VDR Version
+ {icon} icon path
-->
<header>
<area x="0" y="0" width="70%" height="7%" layer="2">
- <drawtext x="10" valign="center" font="{light}" fontsize="80%" color="{clrWhite}" text="{title}" />
+ <drawimage name="menuicon" imagetype="menuicon" path="{icon}" x="5" valign="center" width="{areaheight}*8/10" height="80%"/>
+ <drawtext x="{areaheight}" valign="center" font="{light}" fontsize="80%" color="{clrWhite}" text="{title}" />
</area>
</header>
<!-- Available Variables datetime:
diff --git a/skinskeleton/xmlfiles/displaymenuschedules.xml b/skinskeleton/xmlfiles/displaymenuschedules.xml
index 281535e..5864fcf 100644
--- a/skinskeleton/xmlfiles/displaymenuschedules.xml
+++ b/skinskeleton/xmlfiles/displaymenuschedules.xml
@@ -2,6 +2,8 @@
<!-- Available Variables header:
{title} title of current menu
{vdrversion} running VDR Version
+ {hasicon} true if a menu icon is available
+ {icon} path of menu icon
{channelnumber} Number of Channel of current event
{channelname} Name of current Channel of current event
{channellogoexists} true if a channel logo exists
diff --git a/views/displaymenurootview.c b/views/displaymenurootview.c
index db4b079..7c8ee6a 100644
--- a/views/displaymenurootview.c
+++ b/views/displaymenurootview.c
@@ -6,6 +6,7 @@
#include "../libcore/helpers.h"
cDisplayMenuRootView::cDisplayMenuRootView(cTemplateView *rootView) : cView(rootView) {
+ cat = mcUndefined;
viewType = svUndefined;
subView = NULL;
subViewAvailable = false;
@@ -81,6 +82,7 @@ bool cDisplayMenuRootView::createOsd(void) {
void cDisplayMenuRootView::SetMenu(eMenuCategory menuCat, bool menuInit) {
eSubView newViewType = svUndefined;
+ cat = menuCat;
bool isListView = true;
switch (menuCat) {
case mcMain:
@@ -157,7 +159,7 @@ void cDisplayMenuRootView::SetMenu(eMenuCategory menuCat, bool menuInit) {
default:
view = new cDisplayMenuView(subView, menuInit);
}
-
+ view->SetMenuCat(cat);
//Cleanup root view
ClearRootView();
@@ -408,7 +410,8 @@ void cDisplayMenuRootView::DrawHeader(void) {
//check for standard menu entries
bool hasIcon = false;
- string icon = imgCache->GetIconName(menuTitle);
+
+ string icon = imgCache->GetIconName(menuTitle, cat);
if (icon.size() > 0)
hasIcon = true;
diff --git a/views/displaymenurootview.h b/views/displaymenurootview.h
index 2979746..0852570 100644
--- a/views/displaymenurootview.h
+++ b/views/displaymenurootview.h
@@ -8,6 +8,7 @@
class cDisplayMenuRootView : public cView {
private:
+ eMenuCategory cat;
eSubView viewType;
cTemplateView *subView;
bool subViewAvailable;
diff --git a/views/displaymenuview.c b/views/displaymenuview.c
index 47c1591..f5a841c 100644
--- a/views/displaymenuview.c
+++ b/views/displaymenuview.c
@@ -41,7 +41,7 @@ bool cDisplayMenuView::DrawHeader(void) {
//check for standard menu entries
bool hasIcon = false;
- string icon = imgCache->GetIconName(menuTitle);
+ string icon = imgCache->GetIconName(menuTitle, cat);
if (icon.size() > 0)
hasIcon = true;
stringTokens.insert(pair<string,string>("icon", icon));
@@ -435,6 +435,13 @@ bool cDisplayMenuSchedulesView::DrawHeader(void) {
stringTokens.insert(pair<string,string>("channelid", *(channel->GetChannelID().ToString())));
}
+ bool hasIcon = false;
+ string icon = imgCache->GetIconName(menuTitle, cat);
+ if (icon.size() > 0)
+ hasIcon = true;
+
+ stringTokens.insert(pair<string,string>("icon", icon));
+ intTokens.insert(pair<string,int>("hasicon", hasIcon));
ClearViewElement(veHeader);
DrawViewElement(veHeader, &stringTokens, &intTokens);
return true;