summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-03-31 18:03:50 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-04-03 14:00:05 +0200
commit8ae5d34bef5bb1602225eed17e1899fc71f6c4a4 (patch)
tree0b3c8bb7afa730d386f6759f7f3945d0ffcc3bc3
parent7d44c8f91f244d2d7c9793c9ea985567c21f2559 (diff)
downloadvdr-plugin-tvguide-8ae5d34bef5bb1602225eed17e1899fc71f6c4a4.tar.gz
vdr-plugin-tvguide-8ae5d34bef5bb1602225eed17e1899fc71f6c4a4.tar.bz2
Inactive timer in DrawHeader
-rw-r--r--view.c33
-rw-r--r--view.h3
2 files changed, 26 insertions, 10 deletions
diff --git a/view.c b/view.c
index 3afa7ab..a2074b2 100644
--- a/view.c
+++ b/view.c
@@ -1,4 +1,5 @@
#include "detailview.h"
+#include "switchtimer.h"
/********************************************************************************************
* cView
@@ -15,6 +16,7 @@ cView::cView(void) {
pixmapBackground = NULL;
pixmapHeader = NULL;
pixmapHeaderLogo = NULL;
+ pixmapHeaderIcon = NULL;
pixmapContent = NULL;
pixmapTabs = NULL;
pixmapScrollbar = NULL;
@@ -45,6 +47,8 @@ cView::~cView(void) {
delete pixmapHeader;
if (pixmapHeaderLogo)
osdManager.releasePixmap(pixmapHeaderLogo);
+ if (pixmapHeaderIcon)
+ osdManager.releasePixmap(pixmapHeaderIcon);
if (pixmapContent)
osdManager.releasePixmap(pixmapContent);
if (pixmapTabs)
@@ -120,7 +124,7 @@ void cView::DrawHeader(void) {
pixmapHeader->DrawText(cPoint(xText, yTitle), CutText(title, textWidthMax, fontHeaderLarge).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeaderLarge);
pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader);
//REC Icon
- eTimerMatch timerMatch=tmNone;
+ eTimerMatch timerMatch = tmNone;
if (!event)
return;
const cTimer *ti;
@@ -138,14 +142,25 @@ void cView::DrawHeader(void) {
ti = Timers.GetMatch(event, &timerMatch);
#endif
}
- if (ti && timerMatch == tmFull) {
- cString recIconText(" REC ");
- int widthIcon = fontManager.FontDetailHeader->Width(*recIconText);
- int height = fontManager.FontDetailHeader->Height()+10;
- int posX = headerWidth - widthIcon - 20;
- int posY = 20;
- pixmapHeader->DrawRectangle( cRect(posX, posY, widthIcon, height), theme.Color(clrButtonRed));
- pixmapHeader->DrawText(cPoint(posX, posY+5), *recIconText, theme.Color(clrFont), theme.Color(clrButtonRed), fontManager.FontDetailHeader);
+ bool hasSwitchTimer = SwitchTimers.EventInSwitchList(event);
+ if (hasSwitchTimer || (ti && timerMatch == tmFull)) {
+ tColor iconColor;
+ bool switchOnly = false;
+ bool timerActive = ti && ti->HasFlags(tfActive);
+ cString recIconText;
+#ifdef SWITCHONLYPATCH
+ switchOnly = ti && ti->HasFlags(tfSwitchOnly);
+#endif
+ (hasSwitchTimer || switchOnly) ? recIconText = "Switch" : recIconText = " REC ";
+ iconColor = (hasSwitchTimer || switchOnly) ? theme.Color(clrButtonYellow) : timerActive ? theme.Color(clrButtonRed) : theme.Color(clrButtonGreen);
+ int widthIcon = fontManager.FontDetailHeader->Width(*recIconText) + 10;
+ int height = fontManager.FontDetailHeader->Height() + 10;
+ int posX = headerWidth - widthIcon - 25;
+ int posY = ySubtitle - 5;
+ if (!pixmapHeaderIcon)
+ pixmapHeaderIcon = osdManager.requestPixmap(7, cRect(posX, posY, widthIcon, height));
+ pixmapHeaderIcon->DrawRectangle(cRect(0, 0, widthIcon, height), iconColor);
+ pixmapHeaderIcon->DrawText(cPoint(5, 5), *recIconText, theme.Color(clrFont), iconColor, fontManager.FontDetailHeader);
}
}
diff --git a/view.h b/view.h
index 5581390..8e30c3f 100644
--- a/view.h
+++ b/view.h
@@ -35,6 +35,7 @@ protected:
cPixmap *pixmapBackground;
cStyledPixmap *pixmapHeader;
cPixmap *pixmapHeaderLogo;
+ cPixmap *pixmapHeaderIcon;
cPixmap *pixmapContent;
cPixmap *pixmapScrollbar;
cPixmap *pixmapScrollbarBack;
@@ -146,4 +147,4 @@ public:
void Action(void);
};
-#endif //__TVGUIDE_VIEW_H \ No newline at end of file
+#endif //__TVGUIDE_VIEW_H