mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
CBEChannelWidget: use CComponentsInfoBox to paint text into infobox
This commit is contained in:
@@ -106,7 +106,7 @@ void CBEChannelWidget::paintItem(int pos)
|
|||||||
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
|
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
|
||||||
|
|
||||||
if(current < Channels->size()) {
|
if(current < Channels->size()) {
|
||||||
paintItem2DetailsLine (pos, current);
|
initItem2DetailsLine (pos, current);
|
||||||
paintDetails(current);
|
paintDetails(current);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,8 +184,10 @@ void CBEChannelWidget::paintFoot()
|
|||||||
::paintButtons(x, y + (height-footerHeight), width, 4, CBEChannelWidgetButtons, footerHeight);
|
::paintButtons(x, y + (height-footerHeight), width, 4, CBEChannelWidgetButtons, footerHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBEChannelWidget::paintDetails(int index)
|
std::string CBEChannelWidget::getInfoText(int index)
|
||||||
{
|
{
|
||||||
|
std::string res = "";
|
||||||
|
|
||||||
std::string satname = CServiceManager::getInstance()->GetSatelliteName((*Channels)[index]->getSatellitePosition());
|
std::string satname = CServiceManager::getInstance()->GetSatelliteName((*Channels)[index]->getSatellitePosition());
|
||||||
transponder t;
|
transponder t;
|
||||||
CServiceManager::getInstance()->GetTransponder((*Channels)[index]->getTransponderId(), t);
|
CServiceManager::getInstance()->GetTransponder((*Channels)[index]->getTransponderId(), t);
|
||||||
@@ -195,11 +197,24 @@ void CBEChannelWidget::paintDetails(int index)
|
|||||||
else
|
else
|
||||||
desc = desc + " (" + satname + ")";
|
desc = desc + " (" + satname + ")";
|
||||||
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight+INFO_BOX_Y_OFFSET, width - 30, satname.c_str(), COL_MENUCONTENTDARK, 0, true);
|
res = satname + "\n" + desc;
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight+INFO_BOX_Y_OFFSET, width - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true);
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBEChannelWidget::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
void CBEChannelWidget::paintDetails(int index)
|
||||||
|
{
|
||||||
|
//details line
|
||||||
|
dline->paint();
|
||||||
|
|
||||||
|
std::string str = getInfoText(index);
|
||||||
|
|
||||||
|
//info box
|
||||||
|
ibox->setText(str, CTextBox::AUTO_WIDTH | CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]);
|
||||||
|
ibox->paint(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/)
|
||||||
{
|
{
|
||||||
#define ConnectLineBox_Width 16
|
#define ConnectLineBox_Width 16
|
||||||
|
|
||||||
@@ -212,13 +227,12 @@ void CBEChannelWidget::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
|||||||
if (dline)
|
if (dline)
|
||||||
dline->kill(); //kill details line
|
dline->kill(); //kill details line
|
||||||
|
|
||||||
// paint Line if detail info (and not valid list pos)
|
// init Line if detail info (and not valid list pos)
|
||||||
if (pos >= 0)
|
if (pos >= 0)
|
||||||
{
|
{
|
||||||
if (dline == NULL)
|
if (dline == NULL)
|
||||||
dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2+1, info_height-RADIUS_LARGE*2);
|
dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2+1, info_height-RADIUS_LARGE*2);
|
||||||
dline->setYPos(ypos1a);
|
dline->setYPos(ypos1a);
|
||||||
dline->paint();
|
|
||||||
|
|
||||||
//infobox
|
//infobox
|
||||||
if (ibox){
|
if (ibox){
|
||||||
@@ -228,11 +242,8 @@ void CBEChannelWidget::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
|||||||
ibox->paint(false,true);
|
ibox->paint(false,true);
|
||||||
#endif
|
#endif
|
||||||
ibox->setCornerRadius(RADIUS_LARGE);
|
ibox->setCornerRadius(RADIUS_LARGE);
|
||||||
ibox->syncSysColors();
|
|
||||||
ibox->setShadowOnOff(CC_SHADOW_OFF);
|
ibox->setShadowOnOff(CC_SHADOW_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
ibox->paint(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -84,7 +84,7 @@ class CBEChannelWidget : public CMenuTarget
|
|||||||
|
|
||||||
void paintItem(int pos);
|
void paintItem(int pos);
|
||||||
void paintDetails(int index);
|
void paintDetails(int index);
|
||||||
void paintItem2DetailsLine (int pos, int ch_index);
|
void initItem2DetailsLine (int pos, int ch_index);
|
||||||
void clearItem2DetailsLine ();
|
void clearItem2DetailsLine ();
|
||||||
void paint();
|
void paint();
|
||||||
void paintHead();
|
void paintHead();
|
||||||
@@ -99,6 +99,7 @@ class CBEChannelWidget : public CMenuTarget
|
|||||||
void cancelMoveChannel();
|
void cancelMoveChannel();
|
||||||
void internalMoveChannel( unsigned int fromPosition, unsigned int toPosition);
|
void internalMoveChannel( unsigned int fromPosition, unsigned int toPosition);
|
||||||
|
|
||||||
|
std::string getInfoText(int index);
|
||||||
public:
|
public:
|
||||||
CBEChannelWidget( const std::string & Caption, unsigned int Bouquet);
|
CBEChannelWidget( const std::string & Caption, unsigned int Bouquet);
|
||||||
~CBEChannelWidget();
|
~CBEChannelWidget();
|
||||||
|
Reference in New Issue
Block a user