mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Inactive timer in DrawHeader
This commit is contained in:
parent
7d44c8f91f
commit
8ae5d34bef
33
view.c
33
view.c
@ -1,4 +1,5 @@
|
|||||||
#include "detailview.h"
|
#include "detailview.h"
|
||||||
|
#include "switchtimer.h"
|
||||||
|
|
||||||
/********************************************************************************************
|
/********************************************************************************************
|
||||||
* cView
|
* cView
|
||||||
@ -15,6 +16,7 @@ cView::cView(void) {
|
|||||||
pixmapBackground = NULL;
|
pixmapBackground = NULL;
|
||||||
pixmapHeader = NULL;
|
pixmapHeader = NULL;
|
||||||
pixmapHeaderLogo = NULL;
|
pixmapHeaderLogo = NULL;
|
||||||
|
pixmapHeaderIcon = NULL;
|
||||||
pixmapContent = NULL;
|
pixmapContent = NULL;
|
||||||
pixmapTabs = NULL;
|
pixmapTabs = NULL;
|
||||||
pixmapScrollbar = NULL;
|
pixmapScrollbar = NULL;
|
||||||
@ -45,6 +47,8 @@ cView::~cView(void) {
|
|||||||
delete pixmapHeader;
|
delete pixmapHeader;
|
||||||
if (pixmapHeaderLogo)
|
if (pixmapHeaderLogo)
|
||||||
osdManager.releasePixmap(pixmapHeaderLogo);
|
osdManager.releasePixmap(pixmapHeaderLogo);
|
||||||
|
if (pixmapHeaderIcon)
|
||||||
|
osdManager.releasePixmap(pixmapHeaderIcon);
|
||||||
if (pixmapContent)
|
if (pixmapContent)
|
||||||
osdManager.releasePixmap(pixmapContent);
|
osdManager.releasePixmap(pixmapContent);
|
||||||
if (pixmapTabs)
|
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, 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);
|
pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader);
|
||||||
//REC Icon
|
//REC Icon
|
||||||
eTimerMatch timerMatch=tmNone;
|
eTimerMatch timerMatch = tmNone;
|
||||||
if (!event)
|
if (!event)
|
||||||
return;
|
return;
|
||||||
const cTimer *ti;
|
const cTimer *ti;
|
||||||
@ -138,14 +142,25 @@ void cView::DrawHeader(void) {
|
|||||||
ti = Timers.GetMatch(event, &timerMatch);
|
ti = Timers.GetMatch(event, &timerMatch);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (ti && timerMatch == tmFull) {
|
bool hasSwitchTimer = SwitchTimers.EventInSwitchList(event);
|
||||||
cString recIconText(" REC ");
|
if (hasSwitchTimer || (ti && timerMatch == tmFull)) {
|
||||||
int widthIcon = fontManager.FontDetailHeader->Width(*recIconText);
|
tColor iconColor;
|
||||||
int height = fontManager.FontDetailHeader->Height()+10;
|
bool switchOnly = false;
|
||||||
int posX = headerWidth - widthIcon - 20;
|
bool timerActive = ti && ti->HasFlags(tfActive);
|
||||||
int posY = 20;
|
cString recIconText;
|
||||||
pixmapHeader->DrawRectangle( cRect(posX, posY, widthIcon, height), theme.Color(clrButtonRed));
|
#ifdef SWITCHONLYPATCH
|
||||||
pixmapHeader->DrawText(cPoint(posX, posY+5), *recIconText, theme.Color(clrFont), theme.Color(clrButtonRed), fontManager.FontDetailHeader);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
view.h
3
view.h
@ -35,6 +35,7 @@ protected:
|
|||||||
cPixmap *pixmapBackground;
|
cPixmap *pixmapBackground;
|
||||||
cStyledPixmap *pixmapHeader;
|
cStyledPixmap *pixmapHeader;
|
||||||
cPixmap *pixmapHeaderLogo;
|
cPixmap *pixmapHeaderLogo;
|
||||||
|
cPixmap *pixmapHeaderIcon;
|
||||||
cPixmap *pixmapContent;
|
cPixmap *pixmapContent;
|
||||||
cPixmap *pixmapScrollbar;
|
cPixmap *pixmapScrollbar;
|
||||||
cPixmap *pixmapScrollbarBack;
|
cPixmap *pixmapScrollbarBack;
|
||||||
@ -146,4 +147,4 @@ public:
|
|||||||
void Action(void);
|
void Action(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__TVGUIDE_VIEW_H
|
#endif //__TVGUIDE_VIEW_H
|
||||||
|
Loading…
Reference in New Issue
Block a user