summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-02-15 16:55:09 +0100
committerMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-02-15 16:55:09 +0100
commitce3f1e6df06b3c25398fd5d958427ecc9edcaa2e (patch)
tree36a47adee4ebf0f9e116c31974fc7d5954e5dea8
parentaeae728ce0bbd60ccb04962c0384b9510efdfeb7 (diff)
downloadskin-flatplus-ce3f1e6df06b3c25398fd5d958427ecc9edcaa2e.tar.gz
skin-flatplus-ce3f1e6df06b3c25398fd5d958427ecc9edcaa2e.tar.bz2
SetItemEvent fixes
-rw-r--r--config.c1
-rw-r--r--displaymenu.c63
-rw-r--r--setup.c1
-rw-r--r--setup.h3
4 files changed, 36 insertions, 32 deletions
diff --git a/config.c b/config.c
index cca894b6..7eb2e4a1 100644
--- a/config.c
+++ b/config.c
@@ -434,6 +434,7 @@ bool stringCompare( const std::string &left, const std::string &right ) {
void cFlatConfig::DecorDescriptions(cStringList &Decors) {
cString decorPath = cString::sprintf("%s/decors", PLUGINRESOURCEPATH);
std::vector<std::string> files;
+ Decors.Clear();
cReadDir d(decorPath);
struct dirent *e;
diff --git a/displaymenu.c b/displaymenu.c
index a01bc244..a6bf95c3 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -1079,7 +1079,7 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current
}
bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current, bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch) {
- if( !Event || Config.MenuEventView == 0 )
+ if( Config.MenuEventView == 0 )
return false;
cImage *img = NULL;
@@ -1153,12 +1153,14 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current
if( Channel ) {
cString ws = cString::sprintf("%d", Channels.MaxNumber());
w = font->Width(ws);
- buffer = cString::sprintf("%d", Channel->Number());
- int Width = font->Width(buffer);
- if( Width < w )
- Width = w;
- menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorFg, ColorBg, font, Width, fontHeight, taRight);
- Left += Width + marginItem;
+ if( !Channel->GroupSep() ) {
+ buffer = cString::sprintf("%d", Channel->Number());
+ int Width = font->Width(buffer);
+ if( Width < w )
+ Width = w;
+ menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorFg, ColorBg, font, Width, fontHeight, taRight);
+ }
+ Left += w + marginItem;
img = imgLoader.LoadLogo(Channel->Name(), fontHeight, fontHeight);
if( img ) {
@@ -1196,7 +1198,7 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current
Left += w + marginItem * 2;
}
- if( WithDate ) {
+ if( WithDate && Event ) {
if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) && Channel )
w = fontSml->Width("XXX 99. ") + marginItem;
else
@@ -1219,17 +1221,17 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current
}
int imageHeight = fontHeight;
- if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) && Channel ) {
+ if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) && Channel && Event ) {
Top += fontHeight;
Left = LeftSecond;
imageHeight = fontSmlHeight;
menuPixmap->DrawText(cPoint(Left, Top), Event->GetTimeString(), ColorFg, ColorBg, fontSml);
Left += fontSml->Width( Event->GetTimeString() ) + marginItem;
- } else if( Config.MenuEventView == 2 || Config.MenuEventView == 3 ){
+ } else if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) && Event ){
imageHeight = fontHeight;
menuPixmap->DrawText(cPoint(Left, Top), Event->GetTimeString(), ColorFg, ColorBg, font);
Left += font->Width( Event->GetTimeString() ) + marginItem;
- } else {
+ } else if( Event ){
menuPixmap->DrawText(cPoint(Left, Top), Event->GetTimeString(), ColorFg, ColorBg, font);
Left += font->Width( Event->GetTimeString() ) + marginItem;
}
@@ -1248,27 +1250,28 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current
}
}
Left += imageHeight + marginItem;
-
- if( Event->Vps() && (Event->Vps() - Event->StartTime()) ) {
- img = imgLoader.LoadIcon("vps", imageHeight, imageHeight);
- if( img ) {
- imageTop = Top;
- menuIconsPixmap->DrawImage( cPoint(Left, imageTop), *img );
- }
- }
- Left += imageHeight + marginItem;
+ if( Event ) {
+ if( Event->Vps() && (Event->Vps() - Event->StartTime()) ) {
+ img = imgLoader.LoadIcon("vps", imageHeight, imageHeight);
+ if( img ) {
+ imageTop = Top;
+ menuIconsPixmap->DrawImage( cPoint(Left, imageTop), *img );
+ }
+ }
+ Left += imageHeight + marginItem;
- if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) && Channel )
- menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
- else if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) ) {
- menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
-
- } else
- menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) && Channel )
+ menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ else if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) ) {
+ menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+
+ } else
+ menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
- if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) && !Channel ) {
- Top += fontHeight;
- menuPixmap->DrawText(cPoint(Left, Top), Event->ShortText(), ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) && !Channel ) {
+ Top += fontHeight;
+ menuPixmap->DrawText(cPoint(Left, Top), Event->ShortText(), ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ }
}
sDecorBorder ib;
diff --git a/setup.c b/setup.c
index db07c1e1..773c981e 100644
--- a/setup.c
+++ b/setup.c
@@ -5,6 +5,7 @@ cStringList Progresstypes;
cStringList MenuChannelViews;
cStringList MenuTimerViews;
cStringList MenuEventViews;
+cStringList DecorDescriptions;
cFlatSetup::cFlatSetup(void) {
SetupConfig = Config;
diff --git a/setup.h b/setup.h
index 003ac54d..89c9081d 100644
--- a/setup.h
+++ b/setup.h
@@ -30,7 +30,6 @@ class cMenuSetupSubMenu : public cOsdMenu {
class cFlatSetupGeneral : public cMenuSetupSubMenu {
private:
- cStringList DecorDescriptions;
protected:
void Setup(void);
public:
@@ -76,4 +75,4 @@ class cFlatSetupTracks : public cMenuSetupSubMenu {
public:
cFlatSetupTracks(cFlatConfig *data);
virtual eOSState ProcessKey(eKeys Key);
-}; \ No newline at end of file
+};