From 28b602a8b30c458ae6e52c46b440a5e2b27b67b1 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Sun, 22 Jul 2012 16:47:42 +0200 Subject: [PATCH] * Bouqueteditor: CComponentsInfoBox use to paint infobox --- src/gui/bedit/bouqueteditor_channels.cpp | 26 +++++++++++----------- src/gui/bedit/bouqueteditor_channels.h | 1 + src/gui/bedit/bouqueteditor_chanselect.cpp | 25 ++++++++++++++------- src/gui/bedit/bouqueteditor_chanselect.h | 1 + 4 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 9dddd94ec..00fa4d5e0 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -88,12 +88,14 @@ CBEChannelWidget::CBEChannelWidget(const std::string & Caption, unsigned int Bou bouquet = Bouquet; mode = CZapitClient::MODE_TV; dline = NULL; + ibox = NULL; Channels = NULL; } CBEChannelWidget::~CBEChannelWidget() { delete dline; + delete ibox; } void CBEChannelWidget::paintItem(int pos) @@ -107,9 +109,6 @@ void CBEChannelWidget::paintItem(int pos) color = COL_MENUCONTENTSELECTED; 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()) { paintItem2DetailsLine (pos, current); paintDetails(current); @@ -200,8 +199,8 @@ void CBEChannelWidget::paintDetails(int index) else 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+ 2*fheight, width - 30, desc.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+INFO_BOX_Y_OFFSET, width - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true); } 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 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 ypos2a = ypos2 + (info_height/2)-2; - fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6; - // clear details line - if (dline != NULL) - dline->hide(); + clearItem2DetailsLine(); // paint Line if detail info (and not valid list pos) if (pos >= 0) @@ -227,15 +223,19 @@ void CBEChannelWidget::paintItem2DetailsLine (int pos, int /*ch_index*/) dline->setYPos(ypos1a); dline->paint(); - //info box frame - frameBuffer->paintBoxFrame(x, ypos2, width, info_height, 2, col1, RADIUS_LARGE); + //infobox + if (ibox == NULL) + ibox = new CComponentsInfoBox(x, ypos2, width, info_height, false); + ibox->paint(false); } } -void CBEChannelWidget::clearItem2DetailsLine () +void CBEChannelWidget::clearItem2DetailsLine() { if (dline != NULL) dline->hide(); + if (ibox != NULL) + ibox->hide(); } void CBEChannelWidget::hide() diff --git a/src/gui/bedit/bouqueteditor_channels.h b/src/gui/bedit/bouqueteditor_channels.h index 0c692186d..bcc653e74 100644 --- a/src/gui/bedit/bouqueteditor_channels.h +++ b/src/gui/bedit/bouqueteditor_channels.h @@ -48,6 +48,7 @@ class CBEChannelWidget : public CMenuTarget private: CFrameBuffer *frameBuffer; CComponentsDetailLine *dline; + CComponentsInfoBox *ibox; enum state_ { diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 9f889bb9b..e2f787e44 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -74,6 +74,7 @@ CBEChannelSelectWidget::CBEChannelSelectWidget(const std::string & Caption, unsi liststart = 0; bouquetChannels = NULL; dline = NULL; + ibox = NULL; } CBEChannelSelectWidget::~CBEChannelSelectWidget() @@ -82,6 +83,10 @@ CBEChannelSelectWidget::~CBEChannelSelectWidget() if (dline != NULL) dline->hide(); delete dline; + // clear infobox + if (ibox != NULL) + ibox->hide(); + delete ibox; } uint CBEChannelSelectWidget::getItemCount() @@ -115,7 +120,6 @@ void CBEChannelSelectWidget::paintItem(uint32_t itemNr, int paintNr, bool pselec color = COL_MENUCONTENTSELECTED; 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()) { paintItem2DetailsLine (paintNr, itemNr); paintDetails(itemNr); @@ -218,8 +222,8 @@ void CBEChannelSelectWidget::paintDetails(int index) else 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+ 2*fheight, width - 30, desc.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+INFO_BOX_Y_OFFSET, width - 30, desc.c_str(), COL_MENUCONTENTDARK, 0, true); } 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 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 ypos2a = ypos2 + (info_height/2)-2; - fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6; // clear details line if (dline != NULL) dline->hide(); + // clear infobox + if (ibox != NULL) + ibox->hide(); + // paint Line if detail info (and not valid list pos) if (pos >= 0) { if (dline == NULL) dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2+1, info_height-RADIUS_LARGE*2); dline->setYPos(ypos1a); - dline->paint(); + dline->paint(false); - //info box frame - frameBuffer->paintBoxFrame(x, ypos2, width, info_height, 2, col1, RADIUS_LARGE); + //infobox + if (ibox == NULL) + ibox = new CComponentsInfoBox(x, ypos2, width, info_height, false); + ibox->paint(false); } } diff --git a/src/gui/bedit/bouqueteditor_chanselect.h b/src/gui/bedit/bouqueteditor_chanselect.h index e31e93bbe..963862550 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.h +++ b/src/gui/bedit/bouqueteditor_chanselect.h @@ -49,6 +49,7 @@ class CBEChannelSelectWidget : public CListBox CZapitClient::channelsMode mode; bool isChannelInBouquet( int index); CComponentsDetailLine *dline; + CComponentsInfoBox *ibox; uint getItemCount(); void paintItem(uint32_t itemNr, int paintNr, bool selected);