mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
CInfoViewer: try to fix possible display errors on epg text and rest time
Use of hide() before paint and increase width of rest time box should help to avoid this issue.
This commit is contained in:
@@ -224,18 +224,17 @@ void CInfoViewer::ResetPB()
|
||||
}
|
||||
|
||||
if (timescale){
|
||||
if (g_settings.infobar_progressbar == SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_DEFAULT)
|
||||
timescale->kill();
|
||||
delete timescale;
|
||||
timescale = NULL;
|
||||
timescale->reset();
|
||||
}
|
||||
}
|
||||
|
||||
void CInfoViewer::changePB()
|
||||
{
|
||||
ResetPB();
|
||||
timescale = new CProgressBar();
|
||||
timescale->setType(CProgressBar::PB_TIMESCALE);
|
||||
if (!timescale){
|
||||
timescale = new CProgressBar();
|
||||
timescale->setType(CProgressBar::PB_TIMESCALE);
|
||||
}
|
||||
}
|
||||
|
||||
void CInfoViewer::initClock()
|
||||
@@ -430,6 +429,7 @@ void CInfoViewer::paintHead()
|
||||
void CInfoViewer::paintBody()
|
||||
{
|
||||
int h_body = InfoHeightY - header_height - SHADOW_OFFSET;
|
||||
infoViewerBB->initBBOffset();
|
||||
if (!zap_mode)
|
||||
h_body += infoViewerBB->bottom_bar_offset;
|
||||
|
||||
@@ -1653,14 +1653,17 @@ void CInfoViewer::display_Info(const char *current, const char *next,
|
||||
timescale->setValues(pb_p, pb_w);
|
||||
|
||||
//printf("paintProgressBar(%d, %d, %d, %d)\n", BoxEndX - pb_w - SHADOW_OFFSET, ChanNameY - (pb_h + 10) , pb_w, pb_h);
|
||||
}else{
|
||||
if (g_settings.infobar_progressbar == SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_DEFAULT)
|
||||
timescale->kill();
|
||||
}
|
||||
|
||||
int currTimeW = 0;
|
||||
int nextTimeW = 0;
|
||||
if (runningRest)
|
||||
currTimeW = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth(runningRest)+10;
|
||||
currTimeW = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth(runningRest)*2;
|
||||
if (nextDuration)
|
||||
nextTimeW = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth(nextDuration)+10;
|
||||
nextTimeW = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getRenderWidth(nextDuration)*2;
|
||||
int currTimeX = BoxEndX - currTimeW - 10;
|
||||
int nextTimeX = BoxEndX - nextTimeW - 10;
|
||||
|
||||
@@ -1668,12 +1671,6 @@ void CInfoViewer::display_Info(const char *current, const char *next,
|
||||
bool colored_event_C = (g_settings.theme.colored_events_infobar == 1);
|
||||
bool colored_event_N = (g_settings.theme.colored_events_infobar == 2);
|
||||
|
||||
bool restore = false;
|
||||
if (txt_cur_event){
|
||||
if (txt_cur_event_rest && txt_cur_event_rest->isPainted() && txt_cur_event && txt_cur_event->isPainted())
|
||||
restore = true;
|
||||
}
|
||||
|
||||
//current event
|
||||
if (current && update_current){
|
||||
if (txt_cur_event == NULL)
|
||||
@@ -1682,7 +1679,7 @@ void CInfoViewer::display_Info(const char *current, const char *next,
|
||||
txt_cur_event->setDimensionsAll(xStart, CurrInfoY - height, currTimeX - xStart - 5, height);
|
||||
|
||||
txt_cur_event->setText(current, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT);
|
||||
if (restore)
|
||||
if (txt_cur_event->isPainted())
|
||||
txt_cur_event->hide();
|
||||
txt_cur_event->paint(CC_SAVE_SCREEN_YES);
|
||||
|
||||
@@ -1692,7 +1689,7 @@ void CInfoViewer::display_Info(const char *current, const char *next,
|
||||
else
|
||||
txt_cur_start->setDimensionsAll(InfoX, CurrInfoY - height, info_time_width, height);
|
||||
txt_cur_start->setText(runningStart, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT);
|
||||
if (restore)
|
||||
if (txt_cur_event->isPainted())
|
||||
txt_cur_event->hide();
|
||||
txt_cur_start->paint(CC_SAVE_SCREEN_YES);
|
||||
}
|
||||
@@ -1703,7 +1700,7 @@ void CInfoViewer::display_Info(const char *current, const char *next,
|
||||
else
|
||||
txt_cur_event_rest->setDimensionsAll(currTimeX, CurrInfoY - height, currTimeW, height);
|
||||
txt_cur_event_rest->setText(runningRest, CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_C ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT);
|
||||
if (restore)
|
||||
if (txt_cur_event_rest->isPainted())
|
||||
txt_cur_event_rest->hide();
|
||||
txt_cur_event_rest->paint(CC_SAVE_SCREEN_YES);
|
||||
}
|
||||
@@ -1717,7 +1714,7 @@ void CInfoViewer::display_Info(const char *current, const char *next,
|
||||
else
|
||||
txt_next_event->setDimensionsAll(xStart, NextInfoY, nextTimeX - xStart - 5, height);
|
||||
txt_next_event->setText(next, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT);
|
||||
if (restore)
|
||||
if (txt_next_event->isPainted())
|
||||
txt_next_event->hide();
|
||||
txt_next_event->paint(CC_SAVE_SCREEN_YES);
|
||||
|
||||
@@ -1727,7 +1724,7 @@ void CInfoViewer::display_Info(const char *current, const char *next,
|
||||
else
|
||||
txt_next_start->setDimensionsAll(InfoX, NextInfoY, info_time_width, height);
|
||||
txt_next_start->setText(nextStart, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT);
|
||||
if (restore)
|
||||
if (txt_next_start->isPainted())
|
||||
txt_next_start->hide();
|
||||
txt_next_start->paint(CC_SAVE_SCREEN_YES);
|
||||
}
|
||||
@@ -1738,7 +1735,7 @@ void CInfoViewer::display_Info(const char *current, const char *next,
|
||||
else
|
||||
txt_next_in->setDimensionsAll(nextTimeX, NextInfoY, nextTimeW, height);
|
||||
txt_next_in->setText(nextDuration, CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT);
|
||||
if (restore)
|
||||
if (txt_next_in->isPainted())
|
||||
txt_next_in->hide();
|
||||
txt_next_in->paint(CC_SAVE_SCREEN_YES);
|
||||
}
|
||||
|
Reference in New Issue
Block a user