summaryrefslogtreecommitdiff
path: root/skinclassic.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2008-02-10 10:10:44 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2008-02-10 10:10:44 +0100
commit5f9f793d7b629888f2f729a088c6ee8c33ad042b (patch)
tree2ae6b1cde65b9d9af210c78c750b7cefe472abc2 /skinclassic.c
parentdf0e2f0dc8f4fbd31faa6c207931adde4dbe2f0c (diff)
downloadvdr-5f9f793d7b629888f2f729a088c6ee8c33ad042b.tar.gz
vdr-5f9f793d7b629888f2f729a088c6ee8c33ad042b.tar.bz2
Fixed setting the date in the channel display of the classic and sttng skins, to avoid unnecessary OSD access
Diffstat (limited to 'skinclassic.c')
-rw-r--r--skinclassic.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/skinclassic.c b/skinclassic.c
index 11b5ce44..13a6c896 100644
--- a/skinclassic.c
+++ b/skinclassic.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: skinclassic.c 1.19 2008/01/13 12:38:00 kls Exp $
+ * $Id: skinclassic.c 1.20 2008/02/10 10:01:13 kls Exp $
*/
#include "skinclassic.h"
@@ -77,6 +77,7 @@ private:
int lineHeight;
int timeWidth;
bool message;
+ cString lastDate;
public:
cSkinClassicDisplayChannel(bool WithInfo);
virtual ~cSkinClassicDisplayChannel();
@@ -113,6 +114,7 @@ void cSkinClassicDisplayChannel::SetChannel(const cChannel *Channel, int Number)
{
osd->DrawRectangle(0, 0, osd->Width() - 1, lineHeight - 1, Theme.Color(clrBackground));
osd->DrawText(2, 0, ChannelString(Channel, Number), Theme.Color(clrChannelName), Theme.Color(clrBackground), cFont::GetFont(fontOsd));
+ lastDate = NULL;
}
void cSkinClassicDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following)
@@ -147,9 +149,12 @@ void cSkinClassicDisplayChannel::Flush(void)
{
if (!message) {
cString date = DayDateTime();
- const cFont *font = cFont::GetFont(fontSml);
- int w = font->Width(date);
- osd->DrawText(osd->Width() - w - 2, 0, date, Theme.Color(clrChannelDate), Theme.Color(clrBackground), cFont::GetFont(fontSml), w);
+ if (!lastDate || strcmp(date, lastDate)) {
+ const cFont *font = cFont::GetFont(fontSml);
+ int w = font->Width(date);
+ osd->DrawText(osd->Width() - w - 2, 0, date, Theme.Color(clrChannelDate), Theme.Color(clrBackground), cFont::GetFont(fontSml), w);
+ lastDate = date;
+ }
}
osd->Flush();
}