infoviewer: improve infobar scalability

dynamically calculate the x position of current / next info text in infobar
test with "neutrino -r 200 72" ;-)

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@143 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
seife
2010-01-03 17:15:30 +00:00
parent aac9e518c0
commit ed05af412a

View File

@@ -97,6 +97,8 @@ int time_left_width;
int time_dot_width;
int time_width;
int time_height;
int info_time_width;
bool newfreq = true;
char old_timestr[10];
static event_id_t last_curr_id = 0, last_next_id = 0;
@@ -179,6 +181,9 @@ void CInfoViewer::Init()
delete timescale;
timescale = new CProgressBar(pb_blink, -1, -1, 30, GREEN_BAR, 70, true);
/* we need to calculate this only once */
info_time_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth("22:22") + 10;
channel_id = live_channel_id;
lcdUpdateTimer = 0;
}
@@ -1141,7 +1146,11 @@ void CInfoViewer::display_Info(const char *current, const char *next,
int InfoX = ChanInfoX + 10;
if (starttimes)
xStart = BoxStartX + ChanWidth;
{
xStart = InfoX + info_time_width;
if (xStart < BoxStartX + ChanWidth) /* for small fonts, adjusting to the edge of the */
xStart = BoxStartX + ChanWidth; /* channelnumberbox looks better */
}
else
xStart = InfoX;
@@ -1170,7 +1179,7 @@ void CInfoViewer::display_Info(const char *current, const char *next,
{
frameBuffer->paintBox(InfoX, CurrInfoY - height, currTimeX, CurrInfoY, COL_INFOBAR_PLUS_0);
if (runningStart != NULL)
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(InfoX, CurrInfoY, 100, runningStart, COL_INFOBAR, 0, UTF8);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(InfoX, CurrInfoY, info_time_width, runningStart, COL_INFOBAR, 0, UTF8);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(xStart, CurrInfoY, currTimeX - xStart - 5, current, COL_INFOBAR, 0, UTF8);
oldCurrTimeX = currTimeX;
}
@@ -1186,7 +1195,7 @@ void CInfoViewer::display_Info(const char *current, const char *next,
{
frameBuffer->paintBox(InfoX, NextInfoY-height, BoxEndX, NextInfoY, COL_INFOBAR_PLUS_0);
if (nextStart != NULL)
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(InfoX, NextInfoY, 100, nextStart, COL_INFOBAR, 0, UTF8);
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(InfoX, NextInfoY, info_time_width, nextStart, COL_INFOBAR, 0, UTF8);
if (starttimes)
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(xStart, NextInfoY, nextTimeX - xStart - 5, next, COL_INFOBAR, 0, UTF8);
else