mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
* Bouqueteditor: CComponentsInfoBox use to paint infobox
This commit is contained in:
@@ -88,12 +88,14 @@ CBEChannelWidget::CBEChannelWidget(const std::string & Caption, unsigned int Bou
|
|||||||
bouquet = Bouquet;
|
bouquet = Bouquet;
|
||||||
mode = CZapitClient::MODE_TV;
|
mode = CZapitClient::MODE_TV;
|
||||||
dline = NULL;
|
dline = NULL;
|
||||||
|
ibox = NULL;
|
||||||
Channels = NULL;
|
Channels = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CBEChannelWidget::~CBEChannelWidget()
|
CBEChannelWidget::~CBEChannelWidget()
|
||||||
{
|
{
|
||||||
delete dline;
|
delete dline;
|
||||||
|
delete ibox;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBEChannelWidget::paintItem(int pos)
|
void CBEChannelWidget::paintItem(int pos)
|
||||||
@@ -107,9 +109,6 @@ void CBEChannelWidget::paintItem(int pos)
|
|||||||
color = COL_MENUCONTENTSELECTED;
|
color = COL_MENUCONTENTSELECTED;
|
||||||
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
|
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
|
||||||
|
|
||||||
// clear details
|
|
||||||
frameBuffer->paintBoxRel(x+2, y + height + 2, width-4, info_height - 4, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE);
|
|
||||||
|
|
||||||
if(current < Channels->size()) {
|
if(current < Channels->size()) {
|
||||||
paintItem2DetailsLine (pos, current);
|
paintItem2DetailsLine (pos, current);
|
||||||
paintDetails(current);
|
paintDetails(current);
|
||||||
@@ -200,8 +199,8 @@ 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, width - 30, satname.c_str(), COL_MENUCONTENTDARK, 0, true);
|
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);
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight, width - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBEChannelWidget::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
void CBEChannelWidget::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
||||||
@@ -210,14 +209,11 @@ void CBEChannelWidget::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
|||||||
|
|
||||||
int xpos = x - ConnectLineBox_Width;
|
int xpos = x - ConnectLineBox_Width;
|
||||||
int ypos1 = y + theight+0 + pos*fheight;
|
int ypos1 = y + theight+0 + pos*fheight;
|
||||||
int ypos2 = y + height;
|
int ypos2 = y + height + INFO_BOX_Y_OFFSET;
|
||||||
int ypos1a = ypos1 + (fheight/2)-2;
|
int ypos1a = ypos1 + (fheight/2)-2;
|
||||||
int ypos2a = ypos2 + (info_height/2)-2;
|
int ypos2a = ypos2 + (info_height/2)-2;
|
||||||
fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6;
|
|
||||||
|
|
||||||
// clear details line
|
clearItem2DetailsLine();
|
||||||
if (dline != NULL)
|
|
||||||
dline->hide();
|
|
||||||
|
|
||||||
// paint Line if detail info (and not valid list pos)
|
// paint Line if detail info (and not valid list pos)
|
||||||
if (pos >= 0)
|
if (pos >= 0)
|
||||||
@@ -227,8 +223,10 @@ void CBEChannelWidget::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
|||||||
dline->setYPos(ypos1a);
|
dline->setYPos(ypos1a);
|
||||||
dline->paint();
|
dline->paint();
|
||||||
|
|
||||||
//info box frame
|
//infobox
|
||||||
frameBuffer->paintBoxFrame(x, ypos2, width, info_height, 2, col1, RADIUS_LARGE);
|
if (ibox == NULL)
|
||||||
|
ibox = new CComponentsInfoBox(x, ypos2, width, info_height, false);
|
||||||
|
ibox->paint(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,6 +234,8 @@ void CBEChannelWidget::clearItem2DetailsLine ()
|
|||||||
{
|
{
|
||||||
if (dline != NULL)
|
if (dline != NULL)
|
||||||
dline->hide();
|
dline->hide();
|
||||||
|
if (ibox != NULL)
|
||||||
|
ibox->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBEChannelWidget::hide()
|
void CBEChannelWidget::hide()
|
||||||
|
@@ -48,6 +48,7 @@ class CBEChannelWidget : public CMenuTarget
|
|||||||
private:
|
private:
|
||||||
CFrameBuffer *frameBuffer;
|
CFrameBuffer *frameBuffer;
|
||||||
CComponentsDetailLine *dline;
|
CComponentsDetailLine *dline;
|
||||||
|
CComponentsInfoBox *ibox;
|
||||||
|
|
||||||
enum state_
|
enum state_
|
||||||
{
|
{
|
||||||
|
@@ -74,6 +74,7 @@ CBEChannelSelectWidget::CBEChannelSelectWidget(const std::string & Caption, unsi
|
|||||||
liststart = 0;
|
liststart = 0;
|
||||||
bouquetChannels = NULL;
|
bouquetChannels = NULL;
|
||||||
dline = NULL;
|
dline = NULL;
|
||||||
|
ibox = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CBEChannelSelectWidget::~CBEChannelSelectWidget()
|
CBEChannelSelectWidget::~CBEChannelSelectWidget()
|
||||||
@@ -82,6 +83,10 @@ CBEChannelSelectWidget::~CBEChannelSelectWidget()
|
|||||||
if (dline != NULL)
|
if (dline != NULL)
|
||||||
dline->hide();
|
dline->hide();
|
||||||
delete dline;
|
delete dline;
|
||||||
|
// clear infobox
|
||||||
|
if (ibox != NULL)
|
||||||
|
ibox->hide();
|
||||||
|
delete ibox;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint CBEChannelSelectWidget::getItemCount()
|
uint CBEChannelSelectWidget::getItemCount()
|
||||||
@@ -115,7 +120,6 @@ void CBEChannelSelectWidget::paintItem(uint32_t itemNr, int paintNr, bool pselec
|
|||||||
color = COL_MENUCONTENTSELECTED;
|
color = COL_MENUCONTENTSELECTED;
|
||||||
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
|
bgcolor = COL_MENUCONTENTSELECTED_PLUS_0;
|
||||||
|
|
||||||
frameBuffer->paintBoxRel(x+2, y + height + 2, width-4, info_height - 4, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE);
|
|
||||||
if(itemNr < getItemCount()) {
|
if(itemNr < getItemCount()) {
|
||||||
paintItem2DetailsLine (paintNr, itemNr);
|
paintItem2DetailsLine (paintNr, itemNr);
|
||||||
paintDetails(itemNr);
|
paintDetails(itemNr);
|
||||||
@@ -218,8 +222,8 @@ void CBEChannelSelectWidget::paintDetails(int index)
|
|||||||
else
|
else
|
||||||
desc = desc + " (" + satname + ")";
|
desc = desc + " (" + satname + ")";
|
||||||
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ fheight, width - 30, satname.c_str(), COL_MENUCONTENTDARK, 0, true);
|
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);
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 10, y+ height+ 5+ 2*fheight, width - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBEChannelSelectWidget::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
void CBEChannelSelectWidget::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
||||||
@@ -228,25 +232,30 @@ void CBEChannelSelectWidget::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
|||||||
|
|
||||||
int xpos = x - ConnectLineBox_Width;
|
int xpos = x - ConnectLineBox_Width;
|
||||||
int ypos1 = y + theight+0 + pos*fheight;
|
int ypos1 = y + theight+0 + pos*fheight;
|
||||||
int ypos2 = y + height;
|
int ypos2 = y + height + INFO_BOX_Y_OFFSET;
|
||||||
int ypos1a = ypos1 + (fheight/2)-2;
|
int ypos1a = ypos1 + (fheight/2)-2;
|
||||||
int ypos2a = ypos2 + (info_height/2)-2;
|
int ypos2a = ypos2 + (info_height/2)-2;
|
||||||
fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6;
|
|
||||||
|
|
||||||
// clear details line
|
// clear details line
|
||||||
if (dline != NULL)
|
if (dline != NULL)
|
||||||
dline->hide();
|
dline->hide();
|
||||||
|
|
||||||
|
// clear infobox
|
||||||
|
if (ibox != NULL)
|
||||||
|
ibox->hide();
|
||||||
|
|
||||||
// paint Line if detail info (and not valid list pos)
|
// paint 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();
|
dline->paint(false);
|
||||||
|
|
||||||
//info box frame
|
//infobox
|
||||||
frameBuffer->paintBoxFrame(x, ypos2, width, info_height, 2, col1, RADIUS_LARGE);
|
if (ibox == NULL)
|
||||||
|
ibox = new CComponentsInfoBox(x, ypos2, width, info_height, false);
|
||||||
|
ibox->paint(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -49,6 +49,7 @@ class CBEChannelSelectWidget : public CListBox
|
|||||||
CZapitClient::channelsMode mode;
|
CZapitClient::channelsMode mode;
|
||||||
bool isChannelInBouquet( int index);
|
bool isChannelInBouquet( int index);
|
||||||
CComponentsDetailLine *dline;
|
CComponentsDetailLine *dline;
|
||||||
|
CComponentsInfoBox *ibox;
|
||||||
|
|
||||||
uint getItemCount();
|
uint getItemCount();
|
||||||
void paintItem(uint32_t itemNr, int paintNr, bool selected);
|
void paintItem(uint32_t itemNr, int paintNr, bool selected);
|
||||||
|
Reference in New Issue
Block a user