fix clock osd

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1038 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Commit: 970b0ac6a3
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2011-01-22 (Sat, 22 Jan 2011)

Origin message was:
------------------
-fix clock osd

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1038 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
Jacek Jendrzej
2011-01-22 09:06:38 +00:00
parent 8d9d8676fa
commit 5a65f7bb9f
3 changed files with 18 additions and 23 deletions

View File

@@ -36,16 +36,13 @@ CInfoClock::~CInfoClock()
void CInfoClock::paintTime( bool show_dot)
{
char timestr[10];
time_t tm;
char timestr[20];
time_t tm = time(0);
strftime((char*) &timestr, sizeof(timestr), "%H:%M:%S", localtime(&tm));
timestr[2] = show_dot ? ':':'.';
tm = time(0);
if(show_dot)
strftime((char*) &timestr, 20, "%H:%M:%S", localtime(&tm));
else
strftime((char*) &timestr, 20, "%H.%M:%S", localtime(&tm));
frameBuffer->paintBoxRel(x - time_width - 15, y, time_width, time_height, COL_MENUCONTENT_PLUS_0, RADIUS_SMALL);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(x - time_width- 10, y+ time_height, time_width, timestr, COL_MENUCONTENT);
frameBuffer->paintBoxRel(x - time_width - 10, y, time_width, time_height, COL_MENUCONTENT_PLUS_0, RADIUS_SMALL);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(x - time_width- 5, y+ time_height, time_width, timestr, COL_MENUCONTENT);
}
void* CInfoClock::TimerProc(void *arg)
@@ -79,6 +76,6 @@ void CInfoClock::StopClock()
if(thrTimer) {
pthread_cancel(thrTimer);
thrTimer = 0;
frameBuffer->paintBackgroundBoxRel(x - time_width - 15, y, time_width, time_height);
frameBuffer->paintBackgroundBoxRel(x - time_width - 10, y, time_width, time_height);
}
}