Merge branch 'master' into pu/mp

Origin commit data
------------------
Branch: ni/coolstream
Commit: 0ef6e3fe98
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2017-04-27 (Thu, 27 Apr 2017)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2017-04-27 14:27:27 +02:00
6 changed files with 30 additions and 13 deletions

View File

@@ -123,7 +123,6 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl
eventFont = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT;
dline = NULL;
cc_minitv = NULL;
logo_off = 0;
minitv_is_active = false;
headerNew = true;
bouquet = NULL;
@@ -2133,7 +2132,6 @@ void CChannelList::paintHead()
if (!header->getContextBtnObject()->empty())
header->removeContextButtons();
header->enableClock(true, "%H:%M", "%H %M", true);
logo_off = header->getClockObject()->getWidth() + OFFSET_INNER_MID;
header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT);
}else{
@@ -2143,8 +2141,6 @@ void CChannelList::paintHead()
}
}
}
else
logo_off = OFFSET_INNER_MID;
if(g_settings.channellist_show_channellogo){
//ensure to have clean background
@@ -2152,6 +2148,8 @@ void CChannelList::paintHead()
header->setChannelLogo((*chanlist)[selected]->getChannelID(), (*chanlist)[selected]->getName());
header->getChannelLogoObject()->allowPaint(false);
}
else
header->setChannelLogo(0, string());
header->paint(CC_SAVE_SCREEN_NO);
showChannelLogo();
}

View File

@@ -112,7 +112,6 @@ private:
int info_height; // the infobox below mainbox is handled outside height
int x;
int y;
int logo_off;
int pig_width;
int pig_height;
int infozone_width;

View File

@@ -532,6 +532,12 @@ void CComponentsForm::killCCItems(const fb_pixel_t& bg_color, bool ignore_parent
v_cc_items[i]->kill(bg_color, ignore_parent);
}
void CComponentsForm::hideCCItems()
{
for(size_t i=0; i<v_cc_items.size(); i++)
v_cc_items[i]->hide();
}
void CComponentsForm::setPageCount(const u_int8_t& pageCount)
{
u_int8_t new_val = pageCount;

View File

@@ -81,6 +81,16 @@ class CComponentsForm : public CComponentsItem
///NOTE: Items always have parent bindings to "this" and use the parent background color as default! Set parameter 'ignore_parent=true' to ignore parent background color!
virtual void killCCItems(const fb_pixel_t& bg_color, bool ignore_parent);
/**
Removes possible contained items and finally removes
current form from screen and
restores last displayed background before form was painted.
*/
void hide(){hideCCItems(); CCDraw::hide();}
///restore background for all items inside form,
void hideCCItems();
///add an item to form collection, returns id
virtual int addCCItem(CComponentsItem* cc_Item);
///add items from a vector to form collection, returns size/count of items

View File

@@ -274,10 +274,10 @@ void CComponentsHeader::initIcon()
void CComponentsHeader::initLogo()
{
cch_logo.dy_max = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_MIN : cch_logo.dy_max;
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 - cch_logo.dy_max/2, cch_logo.Name, cch_logo.Id, this);
cch_logo_obj = new CComponentsChannelLogoScalable(width/2, height/2 - h_logo/2, cch_logo.Name, cch_logo.Id, this);
else
cch_logo_obj->setChannel(cch_logo.Id, cch_logo.Name);
@@ -285,20 +285,24 @@ void CComponentsHeader::initLogo()
if (cch_logo.dy_max == -1){
int dx_orig = 0, dy_orig = 0 ;
cch_logo_obj->getRealSize(&dx_orig, &dy_orig);
if (cch_logo.dy_max > dy_orig)
cch_logo.dy_max = dy_orig;
if (h_logo > dy_orig)
h_logo = dy_orig;
}
if (cch_logo_obj->hasLogo()){
cch_logo_obj->setHeight(cch_logo.dy_max, true);
cch_logo_obj->setHeight(h_logo, true);
// set id of logo item depends of neighbor items
int logo_id = getCCItemId(cch_logo_obj);
int next_id = logo_id + 1;
int prev_id = logo_id - 1;
//right end
int x_logo_right = getCCItem(next_id) ? getCCItem(next_id)->getXPos() - cch_logo_obj->getWidth() : width - cch_logo_obj->getWidth()-OFFSET_INNER_MID;
int x_logo_right = width - cch_logo_obj->getWidth();
if (cch_btn_obj)
x_logo_right -= cch_btn_obj->getWidth();
if (cch_cl_obj)
x_logo_right -= cch_cl_obj->getWidth();
//left end
int x_logo_left = getCCItem(prev_id) ? getCCItem(prev_id)->getXPos() + getCCItem(prev_id)->getWidth() : 0;

View File

@@ -299,7 +299,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen
virtual void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
///hides item, arg: no_restore see hideCCItem()
void hide(){disableClock(); CComponents::hide();}
void hide(){disableClock(); CComponentsForm::hide();}
///erase current screen without restore of background, it's similar to paintBackgroundBoxRel() from CFrameBuffer
void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1, const int& fblayer_type = CC_FBDATA_TYPES, bool disable_clock = true);