CInfoViewer: try to fix shadow and background behavior in vzap mode

This commit is contained in:
2016-01-23 22:34:08 +01:00
committed by M. Liebmann
parent b23e3c15c3
commit 4cded5afb6

View File

@@ -435,10 +435,21 @@ void CInfoViewer::paintBody()
if(zap_mode) if(zap_mode)
h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0);
if (body == NULL) if (body == NULL){
body = new CComponentsShapeSquare(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); body = new CComponentsShapeSquare(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body);
else }else{
if(txt_cur_event && txt_next_event){
if (h_body != body->getHeight() || y_body != body->getYPos()){
txt_cur_start->getCTextBoxObject()->clearScreenBuffer();
txt_cur_event->getCTextBoxObject()->clearScreenBuffer();
txt_cur_event_rest->getCTextBoxObject()->clearScreenBuffer();
txt_next_start->getCTextBoxObject()->clearScreenBuffer();
txt_next_event->getCTextBoxObject()->clearScreenBuffer();
txt_next_in->getCTextBoxObject()->clearScreenBuffer();
}
}
body->setDimensionsAll(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body); body->setDimensionsAll(ChanInfoX, y_body, BoxEndX-ChanInfoX, h_body);
}
//set corner and shadow modes, consider virtual zap mode //set corner and shadow modes, consider virtual zap mode
body->setCorner(RADIUS_LARGE, (zap_mode) ? CORNER_BOTTOM : CORNER_NONE); body->setCorner(RADIUS_LARGE, (zap_mode) ? CORNER_BOTTOM : CORNER_NONE);
@@ -1636,27 +1647,33 @@ void CInfoViewer::display_Info(const char *current, const char *next,
bool colored_event_C = (g_settings.theme.colored_events_infobar == 1); bool colored_event_C = (g_settings.theme.colored_events_infobar == 1);
bool colored_event_N = (g_settings.theme.colored_events_infobar == 2); 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 //current event
if (current && update_current){ if (current && update_current){
if (txt_cur_event == NULL) if (txt_cur_event == NULL)
txt_cur_event = new CComponentsTextTransp(NULL, xStart, CurrInfoY - height, currTimeX - xStart - 5, height); txt_cur_event = new CComponentsTextTransp(NULL, xStart, CurrInfoY - height, currTimeX - xStart - 5, height);
else else
txt_cur_event->setDimensionsAll(xStart, CurrInfoY - height, currTimeX - xStart - 5, height); 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); 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_rest && txt_cur_event_rest->isPainted())
txt_cur_event_rest->hide();
if (txt_cur_event && txt_cur_event->isPainted())
txt_cur_event->hide(); txt_cur_event->hide();
txt_cur_event->paint(CC_SAVE_SCREEN_YES); txt_cur_event->paint(CC_SAVE_SCREEN_YES);
if (runningStart){ if (runningStart){
if (txt_cur_start == NULL) if (txt_cur_start == NULL)
txt_cur_start = new CComponentsTextTransp(NULL, InfoX, CurrInfoY - height, info_time_width, height); txt_cur_start = new CComponentsTextTransp(NULL, InfoX, CurrInfoY - height, info_time_width, height);
else else
txt_cur_start->setDimensionsAll(InfoX, CurrInfoY - height, info_time_width, height); 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); 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);
txt_cur_start->paint(CC_SAVE_SCREEN_NO); if (restore)
txt_cur_event->hide();
txt_cur_start->paint(CC_SAVE_SCREEN_YES);
} }
if (runningRest){ if (runningRest){
@@ -1665,6 +1682,8 @@ void CInfoViewer::display_Info(const char *current, const char *next,
else else
txt_cur_event_rest->setDimensionsAll(currTimeX, CurrInfoY - height, currTimeW, height); 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); 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)
txt_cur_event_rest->hide();
txt_cur_event_rest->paint(CC_SAVE_SCREEN_YES); txt_cur_event_rest->paint(CC_SAVE_SCREEN_YES);
} }
} }
@@ -1677,7 +1696,9 @@ void CInfoViewer::display_Info(const char *current, const char *next,
else else
txt_next_event->setDimensionsAll(xStart, NextInfoY, nextTimeX - xStart - 5, height); 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); 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);
txt_next_event->paint(CC_SAVE_SCREEN_NO); if (restore)
txt_next_event->hide();
txt_next_event->paint(CC_SAVE_SCREEN_YES);
if (nextStart){ if (nextStart){
if (txt_next_start == NULL) if (txt_next_start == NULL)
@@ -1685,7 +1706,9 @@ void CInfoViewer::display_Info(const char *current, const char *next,
else else
txt_next_start->setDimensionsAll(InfoX, NextInfoY, info_time_width, height); 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); 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);
txt_next_start->paint(CC_SAVE_SCREEN_NO); if (restore)
txt_next_start->hide();
txt_next_start->paint(CC_SAVE_SCREEN_YES);
} }
if (nextDuration){ if (nextDuration){
@@ -1694,7 +1717,9 @@ void CInfoViewer::display_Info(const char *current, const char *next,
else else
txt_next_in->setDimensionsAll(nextTimeX, NextInfoY, nextTimeW, height); 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); txt_next_in->setText(nextDuration, CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO], colored_event_N ? COL_COLORED_EVENTS_TEXT : COL_INFOBAR_TEXT);
txt_next_in->paint(CC_SAVE_SCREEN_NO); if (restore)
txt_next_in->hide();
txt_next_in->paint(CC_SAVE_SCREEN_YES);
} }
} }
@@ -2011,11 +2036,11 @@ void CInfoViewer::killTitle()
clock->kill(); clock->kill();
#endif #endif
body->kill(); body->kill();
#if 0 //not really required to kill epg infos, body does this
if (txt_cur_event) if (txt_cur_event)
txt_cur_event->kill(); txt_cur_event->kill();
if (txt_cur_event_rest) if (txt_cur_event_rest)
txt_cur_event_rest->kill(); txt_cur_event_rest->kill();
#if 0 //not really required to kill epg infos, body does this
if (txt_cur_start) if (txt_cur_start)
txt_cur_start->kill(); txt_cur_start->kill();
if (txt_next_start) if (txt_next_start)