diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index e03acf7e8..32d70dbd8 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -439,8 +439,9 @@ int CChannelList::doChannelMenu(void) previous_channellist_additional = g_settings.channellist_additional; COsdSetup osd_setup; osd_setup.showContextChanlistMenu(this); - //FIXME check font/options changed ? hide(); + ResetModules(); + //FIXME check font/options changed ? calcSize(); ret = -1; } @@ -955,7 +956,11 @@ void CChannelList::hide() header->kill(); frameBuffer->paintBackgroundBoxRel(x, y, full_width, height + OFFSET_INTER + info_height); - clearItem2DetailsLine(); + + //remove details line + if (dline) + dline->kill(); + CInfoClock::getInstance()->enableInfoClock(!CInfoClock::getInstance()->isBlocked()); } @@ -1637,12 +1642,6 @@ void CChannelList::clearItem2DetailsLine() void CChannelList::paintItem2DetailsLine (int pos) { - if (dline){ - dline->kill(); //kill details line - delete dline; - dline = NULL; - } - if (!g_settings.channellist_show_infobox) return; @@ -1652,9 +1651,15 @@ void CChannelList::paintItem2DetailsLine (int pos) // paint Line if detail info (and not valid list pos) if (pos >= 0) { - if (dline == NULL) + if (!dline){ dline = new CComponentsDetailsLine(xpos, ypos1, ypos2, fheight/2, info_height-RADIUS_LARGE*2); - dline->paint(false); + }else{ + dline->setPos(xpos, ypos1); + dline->setYPosDown(ypos2); + dline->setHMarkTop(fheight/2); + dline->setHMarkDown(info_height-RADIUS_LARGE*2); + } + dline->paint(); } } diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index c633c74b9..f6e20c5a0 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -144,8 +144,6 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_cl_sec_format = cch_cl_format; cch_cl_enable_run = false; - cch_text_max_w = width; - addContextButton(buttons); initCCItems(); initParent(parent); @@ -279,10 +277,13 @@ void CComponentsHeader::initLogo() int h_logo = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_MIN : cch_logo.dy_max; if(!cch_logo_obj) - cch_logo_obj = new CComponentsChannelLogoScalable(width/2, height/2 - h_logo/2, cch_logo.Name, cch_logo.Id, this); + cch_logo_obj = new CComponentsChannelLogoScalable(1, height/2 - h_logo/2, cch_logo.Name, cch_logo.Id, this); else cch_logo_obj->setChannel(cch_logo.Id, cch_logo.Name); + // use value 1 as initial value for logo width, ensures downscale with stupid available logo space + cch_logo_obj->setHeight(1, true); + //ensure logo is not larger than original size if in auto mode if (cch_logo.dy_max == -1){ int dx_orig = 0, dy_orig = 0 ; @@ -291,6 +292,7 @@ void CComponentsHeader::initLogo() h_logo = dy_orig; } + //cch_logo_obj->setWidth(1, true); if (cch_logo_obj->hasLogo()){ cch_logo_obj->setHeight(h_logo, true); @@ -535,7 +537,7 @@ void CComponentsHeader::initCaption() cch_btn_obj->setXPos(width - buttons_w); //set required width of caption object - cc_text_w -= (buttons_w + cch_offset); + cc_text_w -= buttons_w; } //clock @@ -550,7 +552,7 @@ void CComponentsHeader::initCaption() cch_cl_obj->setXPos(width - buttons_w - clock_w); //set required width of caption object - cc_text_w -= (clock_w + cch_offset); + cc_text_w -= clock_w; //stop clock if disabled or option run is disabled and clock is running if (cch_cl_enable){ @@ -564,7 +566,6 @@ void CComponentsHeader::initCaption() cch_cl_obj->allowPaint(cch_cl_enable); } - cc_text_w = min(cc_text_w,cch_text_max_w); //create cch_text_obj and add to collection if (cch_text_obj == NULL){ diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 16fa2ddd1..9550d1134 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -106,8 +106,6 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen int cch_icon_w; ///property: internal width for clock object int cch_clock_w; - ///property: internal max width for text object - int cch_text_max_w; ///property: internal x-position for caption object int cch_text_x; ///property: internal offset of context button icons within context button object @@ -193,8 +191,6 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen virtual Font* getCaptionFont(){return cch_font;} ///set text color for caption virtual void setCaptionColor(fb_pixel_t text_color){cch_col_text = text_color;} - ///set max width for caption - virtual void setCaptionMaxWidth(int max_width){cch_text_max_w = max_width;} enum { diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index bf6658969..cde35d13c 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -121,17 +121,22 @@ void reformatExtendedEvents(std::string strItem, std::string strLabel, bool bUse CEpgData::CEpgData() { - bigFonts = false; - frameBuffer = CFrameBuffer::getInstance(); - tmdb_active = false; - mp_movie_info = NULL; - header = NULL; + bigFonts = false; + frameBuffer = CFrameBuffer::getInstance(); + tmdb_active = false; + mp_movie_info = NULL; + header = NULL; + Bottombox = NULL; + lpic = NULL; + rpic = NULL; + lText = NULL; + rText = NULL; + pb = NULL; } CEpgData::~CEpgData() { - delete header; - header = NULL; + ResetModules(); } void CEpgData::start() @@ -712,46 +717,16 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start const int pic_h = 39; toph = std::max(toph, pic_h); - // Calculate offset for the title when logo appears. - int pic_offx = 0; std::string lname; - int logo_w = 0; - int logo_h = 0; - int logo_w_max = ox / 4; - int logo_h_max = toph - 2*OFFSET_INNER_MIN; std::string channel_name; if (mp_info) channel_name = mp_movie_info->channelName; else channel_name = g_Zapit->getChannelName(channel_id); - if (g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(channel_id, channel_name, lname, &logo_w, &logo_h)) - { - if ((logo_h > logo_h_max) || (logo_w > logo_w_max)) - g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, logo_h_max); - pic_offx = logo_w + OFFSET_INNER_MID; - } - - int pos; - std::string text1 = epgData.title; - std::string text2 = ""; - if (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 2*OFFSET_INNER_MID) - { - do - { - pos = text1.find_last_of("[ .]+"); - if (pos != -1) - text1 = text1.substr(0, pos); - } while ((pos != -1) && (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 2*OFFSET_INNER_MID)); - if (epgData.title.length() > text1.length()) // shold never be false in this place - text2 = epgData.title.substr(text1.length()+ 1, uint(-1) ); - } if (!topboxheight) start(); - if (!text2.empty()) - toph = 2 * topboxheight; - sb = oy - toph - botboxheight; // 21.07.2005 - rainerk @@ -869,62 +844,94 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start COSDFader fader(g_settings.theme.menu_Content_alpha); fader.StartFadeIn(); - //show the epg + // show the epg // header + logo - int header_h = std::max(toph, logo_h); if (!header){ - header = new CComponentsShapeSquare(sx, sy, ox, header_h); - header->setCorner(RADIUS_LARGE, CORNER_TOP); - } - header->setDimensionsAll(sx, sy, ox, header_h); - header->setColorBody(COL_MENUHEAD_PLUS_0); - header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); + header = new CComponentsHeader(sx, sy, ox, toph); + header->setColorBody(COL_MENUHEAD_PLUS_0); + header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); + header->enableClock(true, "%H:%M", "%H %M", true); + }else + header->setDimensionsAll(sx, sy, ox, toph); - CComponentsPicture* headerPic = NULL; //NOTE: class CComponentsChannelLogo is preferred for channel logos - if (pic_offx > 0) { - headerPic = new CComponentsPicture(sx + OFFSET_INNER_MID, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); - headerPic->doPaintBg(false); - } - std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1; - CComponentsText headerText(sx + OFFSET_INNER_MID + pic_offx, sy, ox - 2*OFFSET_INNER_MID - pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); - headerText.doPaintBg(false); - headerText.setTextColor(COL_MENUHEAD_TEXT); + header->setCaption(epgData.title); + + if (header->isPainted()) + header->hideCCItems(); + + // set channel logo + header->setChannelLogo(channel_id, channel_name); + + //paint head header->paint(CC_SAVE_SCREEN_NO); - headerText.paint(CC_SAVE_SCREEN_NO); - if (headerPic) - headerPic->paint(CC_SAVE_SCREEN_NO); int showPos = 0; textCount = epgText.size(); showText(showPos, sy + toph); - // small bottom box - frameBuffer->paintBoxRel(sx, sy+oy-botboxheight, ox, botboxheight, COL_MENUHEAD_PLUS_0); - if (!mp_info) - { - static int iw = 0, ih = 0, io = 0; - if (!iw && !ih) - frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_LEFT, &iw, &ih); - if (!io && iw) - io = iw + OFFSET_INNER_MID; + // small bottom box with left/right navigation + if (!Bottombox){ + Bottombox = new CComponentsFrmChain(sx, sy+oy-botboxheight, ox, botboxheight); + Bottombox->setColorBody(COL_MENUFOOT_PLUS_0); + Bottombox->setCornerType(CORNER_NONE); + Bottombox->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom,COL_MENUFOOT_PLUS_0,g_settings.theme.infobar_gradient_bottom_direction); + Bottombox->set2ndColor(COL_MENUCONTENT_PLUS_0); + } + if (!mp_info){ std::string fromto = epg_start + " - " + epg_end; - - int widthl = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(fromto); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+OFFSET_INNER_MID+io, sy+oy-3, widthl, fromto, COL_MENUHEAD_TEXT); - int widthr = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getRenderWidth(epg_date); - g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->RenderString(sx+ox-OFFSET_INNER_MID-io-widthr, sy+oy-3, widthr, epg_date, COL_MENUHEAD_TEXT); + int x_off = OFFSET_INNER_MID; + int mid_width = ox * 40 / 100; // 40% + int side_width = ((ox - mid_width) / 2) - (2 * x_off); GetPrevNextEPGData(epgData.eventID, &epgData.epg_times.startzeit); - if (!call_fromfollowlist) - { - int iy = sy + oy - botboxheight + (botboxheight - iw)/2; - if (prev_id) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_LEFT, sx + OFFSET_INNER_MID, iy); - if (next_id) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RIGHT, sx + ox - iw - OFFSET_INNER_MID, iy); + + // init left arrow + if (!lpic){ + lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT); + lpic->doPaintBg(false); + Bottombox->addCCItem(lpic); + lpic->enableSaveBg(); } + lpic->allowPaint(prev_id && !call_fromfollowlist); + + // init right arrow + if (!rpic){ + rpic = new CComponentsPictureScalable(0,CC_CENTERED,NEUTRINO_ICON_BUTTON_RIGHT); + + rpic->doPaintBg(false); + Bottombox->addCCItem(rpic); + rpic->enableSaveBg(); + int x_pos = ox - rpic->getWidth() - x_off; + rpic->setXPos(x_pos); + } + rpic->allowPaint(next_id && !call_fromfollowlist); + + // init text left "from to" + if (!lText){ + lText = new CComponentsText(x_off + lpic->getWidth() + x_off, CC_CENTERED, side_width, toph, "", CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, NULL, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + lText->doPaintBg(false); + Bottombox->addCCItem(lText); + lText->enableSaveBg(); + } + lText->setText(fromto, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], COL_MENUHEAD_TEXT, CComponentsText::FONT_STYLE_REGULAR); + + // init text right "follow" + if (!rText){ + rText = new CComponentsText(0, CC_CENTERED, side_width, toph, "", CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + rText->doPaintBg(false); + rText->enableSaveBg(); + } + rText->setText(epg_date, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]); + rText->setXPos(rpic->getXPos() - x_off - rText->getWidth()); } + + //ensure clean background + if(Bottombox->isPainted()) + Bottombox->hideCCItems(); + + //paint bottombox contents + Bottombox->paint(false); showProgressBar(); // show Timer Event Buttons @@ -1237,6 +1244,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } case CRCInput::RC_help: bigFonts = bigFonts ? false : true; + ResetModules(); frameBuffer->paintBackgroundBoxRel(sx, sy, ox, oy); showTimerEventBar (false); start(); @@ -1300,8 +1308,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start if(epgTextSwitchClear) epgTextSwitch.clear(); } - if (headerPic) - delete headerPic; return res; } @@ -1314,6 +1320,8 @@ void CEpgData::hide() g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() / BIGFONT_FACTOR)); } + ResetModules(); + frameBuffer->paintBackgroundBoxRel(sx, sy, ox, oy); showTimerEventBar (false); } @@ -1456,18 +1464,21 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st void CEpgData::showProgressBar() { + int w = 104; + int x = sx + (ox - w)/2; + int h = botboxheight - 12; + int y = sy + oy - botboxheight + (botboxheight - h)/2; + if (!pb){ + pb = new CProgressBar(x, y, w, h); + pb->setType(CProgressBar::PB_TIMESCALE); + } //show progressbar if (epg_done != -1) { - int w = 104; - int x = sx + (ox - w)/2; - int h = botboxheight - 12; - int y = sy + oy - botboxheight + (botboxheight - h)/2; - - CProgressBar pb(x, y, w, h); - pb.setType(CProgressBar::PB_TIMESCALE); - pb.setValues(epg_done, 100); - pb.paint(false); + pb->setValues(epg_done, 100); + pb->paint(true); + }else{ + pb->hide(); } } @@ -1542,6 +1553,22 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) } } +void CEpgData::ResetModules() +{ + if (header){ + delete header; header = NULL; + } + if (Bottombox){ + delete Bottombox; Bottombox = NULL; + // bottom box items are destroyed but explicit reset of bottom box items here required + lpic = rpic = NULL; + lText = rText = NULL; + } + if (pb){ + delete pb; pb = NULL; + } +} + // -- EPG Data Viewer Menu Handler Class // -- to be used for calls from Menue // -- (2004-03-06 rasc) diff --git a/src/gui/epgview.h b/src/gui/epgview.h index c7ec15b80..5db5cfa12 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -50,7 +50,11 @@ class CEpgData CChannelEventList evtlist; CChannelEventList followlist; CEPGData epgData; - CComponentsShapeSquare* header; + CComponentsHeader *header; + CComponentsFrmChain *Bottombox; + CComponentsPictureScalable *lpic, *rpic; + CComponentsText *lText, *rText; + CProgressBar *pb; std::string epg_date; std::string epg_start; std::string epg_end; @@ -100,6 +104,7 @@ class CEpgData int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false, bool mp_info = false ); int show_mp(MI_MOVIE_INFO *mi, int mp_position = 0, int mp_duration = 0, bool doLoop = true); void hide(); + void ResetModules(); }; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 2c1a859d7..ebb8d5e8f 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -120,12 +120,26 @@ CEventList::CEventList() oldEventID = -1; bgRightBoxPaint = false; header = NULL; + pb = NULL; + Bottombox = NULL; } CEventList::~CEventList() { - delete header; - header = NULL; + ResetModules(); +} + +void CEventList::ResetModules() +{ + if (header){ + delete header; header = NULL; + } + if (Bottombox){ + delete Bottombox; Bottombox = NULL; + } + if (pb){ + delete pb; pb = NULL; + } } void CEventList::UpdateTimerList(void) @@ -291,8 +305,10 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna fwidth1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth("DDD, :, ") + 4 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getMaxDigitWidth(); //fwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth("[ ] ") + 3 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getMaxDigitWidth() + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(unit_short_minute); - listmaxshow = (height-theight-iheight-0)/fheight; - height = theight+iheight+0+listmaxshow*fheight; // recalc height + botboxheight = fheight1+2*OFFSET_INNER_MIN; + + listmaxshow = (height-theight-iheight-botboxheight-0)/fheight; + height = theight+iheight+botboxheight+0+listmaxshow*fheight; // recalc height y = getScreenStartY(height); // calculate width of right info_zone @@ -682,6 +698,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna void CEventList::hide() { + ResetModules(); frameBuffer->paintBackgroundBoxRel(x,y, full_width,height); } @@ -804,6 +821,9 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) // paint 2nd line text g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x + iw + OFFSET_INNER_MID, ypos + fheight, width - iw - 2*OFFSET_INNER_MID, evtlist[currpos].description, color); + + if (i_radius) + showProgressBar(currpos); } } @@ -847,57 +867,103 @@ void CEventList::paintDescription(int index) void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev, std::string _channelname_next) { - int font_mid = SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE; + if (header == NULL){ + header = new CComponentsHeader(); + header->getTextObject()->enableTboxSaveScreen(g_settings.theme.menu_Head_gradient);//enable screen save for title text if color gradient is in use + header->enableClock(true, "%H:%M", "%H %M", true); + header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); + header->setDimensionsAll(x, y, full_width, theight); + } + //header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); + + if (header->isPainted()) + header->getChannelLogoObject()->hide(); + header->setChannelLogo(_channel_id,_channelname); + header->setCaption(_channelname,CTextBox::CENTER); + + header->paint(CC_SAVE_SCREEN_NO); + + paintBottomBox(_channelname_prev, _channelname_next); +} + +void CEventList::paintBottomBox(std::string _channelname_prev, std::string _channelname_next) +{ + int by = y + height - iheight - botboxheight; int font_lr = SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE; - - if (!header) - header = new CComponentsFrmChain(); - - header->setDimensionsAll(x, y, full_width, theight); - header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); - header->setCorner(RADIUS_LARGE, CORNER_TOP); - header->clear(); - int x_off = OFFSET_INNER_MID; int mid_width = full_width * 40 / 100; // 40% - int max_height = theight - 2*OFFSET_INNER_MIN; int side_width = ((full_width - mid_width) / 2) - (2 * x_off); - //create an logo object - CComponentsChannelLogoScalable* midLogo = new CComponentsChannelLogoScalable(0, 0, _channelname, _channel_id, header); - if (midLogo->hasLogo()) - { - midLogo->setWidth(min(midLogo->getWidth(), mid_width), true); - if (midLogo->getHeight() > max_height) - midLogo->setHeight(max_height, true); - - midLogo->setPos(CC_CENTERED, CC_CENTERED); - - // recalc widths - side_width = ((full_width - midLogo->getWidth()) / 2) - (4 * x_off); - } - else { - header->removeCCItem(midLogo); //remove/destroy logo object, if it is not available - int w_midText = g_Font[font_mid]->getRenderWidth(_channelname); - CComponentsText *midText = new CComponentsText(0, CC_CENTERED, w_midText, theight, _channelname, CTextBox::CENTER, g_Font[font_mid], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); - midText->setXPos(full_width/2 - midText->getWidth()/2); - midText->doPaintBg(false); + if (!Bottombox){ + Bottombox = new CComponentsFrmChain(x, by, full_width, botboxheight); + Bottombox->setColorBody(COL_MENUFOOT_PLUS_0); + Bottombox->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom,COL_MENUFOOT_PLUS_0,g_settings.theme.infobar_gradient_bottom_direction); + Bottombox->set2ndColor(COL_MENUCONTENT_PLUS_0); + }else{ + if (Bottombox->isPainted()) + Bottombox->hideCCItems(); + Bottombox->clear(); } if (!_channelname_prev.empty()) { - CComponentsText *lText = new CComponentsText(x_off, CC_CENTERED, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + CComponentsPictureScalable *lpic = new CComponentsPictureScalable(x_off,CC_CENTERED,NEUTRINO_ICON_BUTTON_LEFT,Bottombox); + lpic->doPaintBg(false); + lpic->enableSaveBg(); + + CComponentsText *lText = new CComponentsText(x_off + lpic->getWidth() + OFFSET_INNER_MID, CC_CENTERED, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); lText->doPaintBg(false); + lText->enableSaveBg(); } if (!_channelname_next.empty()) { - int x_pos = full_width - side_width - x_off; - CComponentsText *rText = new CComponentsText(x_pos, CC_CENTERED, side_width, theight, _channelname_next, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + CComponentsPictureScalable *rpic = new CComponentsPictureScalable(0,CC_CENTERED,NEUTRINO_ICON_BUTTON_RIGHT,Bottombox); + int x_pos = full_width - rpic->getWidth() - OFFSET_INNER_MID; + rpic->doPaintBg(false); + rpic->setXPos(x_pos); + rpic->enableSaveBg(); + + CComponentsText *rText = new CComponentsText(0, CC_CENTERED, side_width, theight, _channelname_next, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, g_Font[font_lr], CComponentsText::FONT_STYLE_REGULAR, Bottombox, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + rText->setXPos(x_pos - OFFSET_INNER_MID - rText->getWidth()); rText->doPaintBg(false); + rText->enableSaveBg(); + } + + Bottombox->paint(false); +} + +void CEventList::showProgressBar(int pos) +{ + int epg_done= -1; + if ((( time(NULL)- evtlist[pos].startTime )>= 0 ) && (evtlist[pos].duration > 0)) + { + unsigned nProcentagePassed = ((time(NULL) - evtlist[pos].startTime) * 100 / evtlist[pos].duration); + if (nProcentagePassed<= 100) + epg_done= nProcentagePassed; + } + + if (!pb) + { + int pbw = 104; + int pbx = x + (full_width - pbw)/2; + int pbh = botboxheight - 12; + int pby = y + height -iheight - botboxheight + (botboxheight - pbh)/2; + + pb = new CProgressBar(pbx, pby, pbw, pbh); + pb->setType(CProgressBar::PB_TIMESCALE); + pb->doPaintBg(false); + } + + //show progressbar + if (epg_done > 0) + { + pb->setValues(epg_done, 100); + pb->paint(true); + } + else + { + pb->hide(); } - if (header->isPainted()) //clean up background of header for new captions - header->kill(header->getColorBody()); - header->paint(CC_SAVE_SCREEN_NO); } void CEventList::paint(t_channel_id channel_id) @@ -998,7 +1064,6 @@ void CEventList::showFunctionBar(t_channel_id channel_id) buttons[btn_cnt].locale = LOCALE_EPGMENU_EVENTINFO; btn_cnt++; } - ::paintButtons(bx, by, bw, btn_cnt, buttons, bw, bh); } diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 90542ba26..8b81aefb5 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -95,6 +95,7 @@ class CEventList : public CListHelpers std::string search_head_name; int full_width, width, infozone_width; + int botboxheight; int height; int x; int y; @@ -102,13 +103,17 @@ class CEventList : public CListHelpers int sort_mode; event_id_t item_event_ID; CComponentsText *cc_infozone; - CComponentsFrmChain *header; + CComponentsHeader *header; + CProgressBar *pb; + CComponentsFrmChain *Bottombox; const char * unit_short_minute; void paintItem(unsigned pos, t_channel_id channel_id = 0); void paintDescription(int index); void paint(t_channel_id channel_id = 0); void paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev = "", std::string _channelname_next = ""); + void paintBottomBox(std::string _channelname_prev, std::string _channelname_next); + void showProgressBar(int pos); void hide(); void showFunctionBar(t_channel_id channel_id); @@ -123,6 +128,7 @@ class CEventList : public CListHelpers CEventList(); ~CEventList(); int exec(const t_channel_id channel_id, const std::string& channelname, const std::string& prev = "", const std::string& next = "", const CChannelEventList &followlist = CChannelEventList ()); // UTF-8 + void ResetModules(); }; class CEventListHandler : public CMenuTarget diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index f85cc093e..09df41c62 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2095,6 +2095,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) { if (m_movieSelectionHandler != NULL) { + m_header->getClockObject()->kill(); framebuffer->paintBackground(); //clear whole screen g_EpgData->show_mp(m_movieSelectionHandler); refresh();