From dd9086b84d645c35f9ff0acc6b2672eabdde09a5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 19 Jul 2012 15:45:00 +0200 Subject: [PATCH] *CBEChannelSelectWidget: remove old detail line handing add dline instance from CComponentsDetailsLine --- src/gui/bedit/bouqueteditor_chanselect.cpp | 37 +++++++++++----------- src/gui/bedit/bouqueteditor_chanselect.h | 4 ++- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index ad0604abd..9f889bb9b 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -72,6 +72,16 @@ CBEChannelSelectWidget::CBEChannelSelectWidget(const std::string & Caption, unsi ButtonHeight = std::max(footerHeight, icol_h+4); liststart = 0; + bouquetChannels = NULL; + dline = NULL; +} + +CBEChannelSelectWidget::~CBEChannelSelectWidget() +{ + // clear details line + if (dline != NULL) + dline->hide(); + delete dline; } uint CBEChannelSelectWidget::getItemCount() @@ -222,30 +232,21 @@ void CBEChannelSelectWidget::paintItem2DetailsLine (int pos, int /*ch_index*/) int ypos1a = ypos1 + (fheight/2)-2; int ypos2a = ypos2 + (info_height/2)-2; fb_pixel_t col1 = COL_MENUCONTENT_PLUS_6; - fb_pixel_t col2 = COL_MENUCONTENT_PLUS_1; - // Clear - frameBuffer->paintBackgroundBoxRel(xpos,y, ConnectLineBox_Width, height+info_height); + // clear details line + if (dline != NULL) + dline->hide(); // paint Line if detail info (and not valid list pos) if (pos >= 0) { - int fh = fheight > 10 ? fheight - 10: 5; - frameBuffer->paintBoxRel(xpos+ConnectLineBox_Width-4, ypos1+5, 4, fh, col1); - frameBuffer->paintBoxRel(xpos+ConnectLineBox_Width-4, ypos1+5, 1, fh, col2); - - frameBuffer->paintBoxRel(xpos+ConnectLineBox_Width-4, ypos2+7, 4,info_height-14, col1); - frameBuffer->paintBoxRel(xpos+ConnectLineBox_Width-4, ypos2+7, 1,info_height-14, col2); - - frameBuffer->paintBoxRel(xpos+ConnectLineBox_Width-16, ypos1a, 4,ypos2a-ypos1a, col1); - frameBuffer->paintBoxRel(xpos+ConnectLineBox_Width-16, ypos1a, 1,ypos2a-ypos1a+4, col2); - - frameBuffer->paintBoxRel(xpos+ConnectLineBox_Width-16, ypos1a, 12,4, col1); - frameBuffer->paintBoxRel(xpos+ConnectLineBox_Width-16, ypos1a, 12,1, col2); - - frameBuffer->paintBoxRel(xpos+ConnectLineBox_Width-16, ypos2a, 12,4, col1); - frameBuffer->paintBoxRel(xpos+ConnectLineBox_Width-12, ypos2a, 8,1, col2); + if (dline == NULL) + dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2+1, info_height-RADIUS_LARGE*2); + dline->setYPos(ypos1a); + dline->paint(); + //info box frame frameBuffer->paintBoxFrame(x, ypos2, width, info_height, 2, col1, RADIUS_LARGE); } } + diff --git a/src/gui/bedit/bouqueteditor_chanselect.h b/src/gui/bedit/bouqueteditor_chanselect.h index 89fc63fe5..e31e93bbe 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.h +++ b/src/gui/bedit/bouqueteditor_chanselect.h @@ -34,7 +34,7 @@ #include #include - +#include #include #include @@ -48,6 +48,7 @@ class CBEChannelSelectWidget : public CListBox unsigned int bouquet; CZapitClient::channelsMode mode; bool isChannelInBouquet( int index); + CComponentsDetailLine *dline; uint getItemCount(); void paintItem(uint32_t itemNr, int paintNr, bool selected); @@ -64,6 +65,7 @@ class CBEChannelSelectWidget : public CListBox ZapitChannelList * bouquetChannels; CBEChannelSelectWidget(const std::string & Caption, unsigned int Bouquet, CZapitClient::channelsMode Mode); + ~CBEChannelSelectWidget(); int exec(CMenuTarget* parent, const std::string & actionKey); bool hasChanged();