mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
CEpgData: hold header instance to prevent flickering on page scroll
Header class is not required here, square-object is adequate, therefore usage of title text object is justified and can be used on stack, heap is not required in this case. Note: Header class provides a title parameter and could do this at once.
This commit is contained in:
@@ -121,6 +121,13 @@ CEpgData::CEpgData()
|
|||||||
bigFonts = false;
|
bigFonts = false;
|
||||||
frameBuffer = CFrameBuffer::getInstance();
|
frameBuffer = CFrameBuffer::getInstance();
|
||||||
tmdbtoggle = false;
|
tmdbtoggle = false;
|
||||||
|
header = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
CEpgData::~CEpgData()
|
||||||
|
{
|
||||||
|
delete header;
|
||||||
|
header = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEpgData::start()
|
void CEpgData::start()
|
||||||
@@ -491,10 +498,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
|
|||||||
tmdbtoggle = false;
|
tmdbtoggle = false;
|
||||||
stars = 0;
|
stars = 0;
|
||||||
|
|
||||||
CComponentsHeader* header = NULL;
|
|
||||||
CComponentsPicture* headerPic = NULL;
|
|
||||||
CComponentsText* headerText = NULL;
|
|
||||||
|
|
||||||
int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight();
|
int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight();
|
||||||
|
|
||||||
t_channel_id epg_id = channel_id;
|
t_channel_id epg_id = channel_id;
|
||||||
@@ -675,17 +678,25 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
|
|||||||
//show the epg
|
//show the epg
|
||||||
// header + logo
|
// header + logo
|
||||||
int header_h = std::max(toph, logo_h);
|
int header_h = std::max(toph, logo_h);
|
||||||
header = new CComponentsHeader(sx, sy, ox, header_h);
|
if (!header){
|
||||||
|
header = new CComponentsShapeSquare(sx, sy, ox, header_h);
|
||||||
|
header->setCorner(RADIUS_LARGE, CORNER_TOP);
|
||||||
|
}
|
||||||
|
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->setHeight(header_h);
|
||||||
|
|
||||||
|
CComponentsPicture* headerPic = NULL; //NOTE: class CComponentsChannelLogo is preferred for channel logos
|
||||||
if (pic_offx > 0) {
|
if (pic_offx > 0) {
|
||||||
headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname);
|
headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname);
|
||||||
headerPic->doPaintBg(false);
|
headerPic->doPaintBg(false);
|
||||||
}
|
}
|
||||||
std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1;
|
std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1;
|
||||||
headerText = new CComponentsText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]);
|
CComponentsText headerText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]);
|
||||||
headerText->doPaintBg(false);
|
headerText.doPaintBg(false);
|
||||||
headerText->setTextColor(COL_MENUHEAD_TEXT);
|
headerText.setTextColor(COL_MENUHEAD_TEXT);
|
||||||
header->paint(CC_SAVE_SCREEN_NO);
|
header->paint(CC_SAVE_SCREEN_NO);
|
||||||
headerText->paint(CC_SAVE_SCREEN_NO);
|
headerText.paint(CC_SAVE_SCREEN_NO);
|
||||||
if (headerPic)
|
if (headerPic)
|
||||||
headerPic->paint(CC_SAVE_SCREEN_NO);
|
headerPic->paint(CC_SAVE_SCREEN_NO);
|
||||||
|
|
||||||
@@ -1057,11 +1068,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
|
|||||||
}
|
}
|
||||||
if (headerPic)
|
if (headerPic)
|
||||||
delete headerPic;
|
delete headerPic;
|
||||||
if (headerText)
|
|
||||||
delete headerText;
|
|
||||||
if (header)
|
|
||||||
delete header;
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -56,7 +56,7 @@ class CEpgData
|
|||||||
CChannelEventList evtlist;
|
CChannelEventList evtlist;
|
||||||
CChannelEventList followlist;
|
CChannelEventList followlist;
|
||||||
CEPGData epgData;
|
CEPGData epgData;
|
||||||
|
CComponentsShapeSquare* header;
|
||||||
std::string epg_date;
|
std::string epg_date;
|
||||||
std::string epg_start;
|
std::string epg_start;
|
||||||
std::string epg_end;
|
std::string epg_end;
|
||||||
@@ -96,6 +96,7 @@ class CEpgData
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
CEpgData();
|
CEpgData();
|
||||||
|
~CEpgData();
|
||||||
void start( );
|
void start( );
|
||||||
int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false );
|
int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false );
|
||||||
void hide();
|
void hide();
|
||||||
|
Reference in New Issue
Block a user