Bedit: adapt for infobox

The combination of infobox handling and screen size management doesn't
really fit together. Particular it  could be better implemented some
inheritance, because incorporated functions and variables are
redundant and so the classes can be better coordinated.
Moreover, it doesn't seem sensible to use only a part of the display.
The use of full screen instead of window could simplify a lot.
This commit is contained in:
2013-02-25 20:23:10 +01:00
parent 10f429ee0f
commit 152d40c6cd
3 changed files with 19 additions and 15 deletions

View File

@@ -123,6 +123,7 @@ void CBEBouquetWidget::paint()
float sbh= (sb- 4)/ sbc; float sbh= (sb- 4)/ sbc;
int sbs= (selected/listmaxshow); int sbs= (selected/listmaxshow);
//scrollbar
frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ int(sbs* sbh) , 11, int(sbh), COL_MENUCONTENT_PLUS_3); frameBuffer->paintBoxRel(x+ width- 13, ypos+ 2+ int(sbs* sbh) , 11, int(sbh), COL_MENUCONTENT_PLUS_3);
} }
@@ -226,9 +227,8 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey*
iconoffset = std::max(iconoffset, icol_w); iconoffset = std::max(iconoffset, icol_w);
int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth();
int fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); width = w_max ((frameBuffer->getScreenWidth() / 20 * (fw+6)), 100);
width = w_max (64 * fw, 20); height = h_max ((frameBuffer->getScreenHeight() / 20 * 18), (frameBuffer->getScreenHeight() / 20 * 2));
height = h_max (20 * fh, 50);
listmaxshow = (height-theight-0)/iheight; listmaxshow = (height-theight-0)/iheight;
height = theight+0+listmaxshow*iheight; // recalc height height = theight+0+listmaxshow*iheight; // recalc height
x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;

View File

@@ -84,7 +84,7 @@ 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 = new CComponentsInfoBox(); ibox = NULL;
Channels = NULL; Channels = NULL;
} }
@@ -211,7 +211,7 @@ void CBEChannelWidget::paintDetails(int index)
//info box //info box
ibox->setText(str, CTextBox::AUTO_WIDTH | CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]); ibox->setText(str, CTextBox::AUTO_WIDTH | CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]);
ibox->paint(false); ibox->paint(CC_SAVE_SCREEN_YES);
} }
void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/) void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/)
@@ -235,15 +235,19 @@ void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/)
dline->setYPos(ypos1a); dline->setYPos(ypos1a);
//infobox //infobox
if (ibox){ if (ibox == NULL)
ibox->setDimensionsAll(x, ypos2, width, info_height); ibox = new CComponentsInfoBox();
ibox->setFrameThickness(2);
if (ibox->isPainted())
ibox->hide(CC_SAVE_SCREEN_NO);
ibox->setDimensionsAll(x, ypos2, width, info_height);
ibox->setFrameThickness(2);
#if 0 #if 0
ibox->paint(false,true); ibox->paint(false,true);
#endif #endif
ibox->setCornerRadius(RADIUS_LARGE); ibox->setCornerRadius(RADIUS_LARGE);
ibox->setShadowOnOff(CC_SHADOW_OFF); ibox->setShadowOnOff(CC_SHADOW_OFF);
}
} }
} }
@@ -295,10 +299,10 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey*
int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth();
width = w_max ((frameBuffer->getScreenWidth() / 20 * (fw+6)), 100); width = w_max ((frameBuffer->getScreenWidth() / 20 * (fw+6)), 100);
height = h_max ((frameBuffer->getScreenHeight() / 20 * 17), (frameBuffer->getScreenHeight() / 20 * 2)); height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2));
listmaxshow = (height-theight-footerHeight-0)/iheight; listmaxshow = (height-theight-footerHeight-0)/iheight;
height = theight+footerHeight+listmaxshow*iheight; // recalc height height = theight+footerHeight+listmaxshow*iheight; // recalc height
info_height = 2*iheight + 10; info_height = 2*iheight + 4;
x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;
y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height + info_height)) / 2; y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height + info_height)) / 2;

View File

@@ -164,10 +164,10 @@ int CBEChannelSelectWidget::exec(CMenuTarget* parent, const std::string & action
{ {
int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth(); int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth();
width = w_max ((frameBuffer->getScreenWidth() / 20 * (fw+6)), 100); width = w_max ((frameBuffer->getScreenWidth() / 20 * (fw+6)), 100);
height = h_max ((frameBuffer->getScreenHeight() / 20 * 17), (frameBuffer->getScreenHeight() / 20 * 2)); height = h_max ((frameBuffer->getScreenHeight() / 20 * 16), (frameBuffer->getScreenHeight() / 20 * 2));
listmaxshow = (height-theight-footerHeight-0)/iheight; listmaxshow = (height-theight-footerHeight-0)/iheight;
height = theight+footerHeight+listmaxshow*iheight; // recalc height height = theight+footerHeight+listmaxshow*iheight; // recalc height
info_height = 2*iheight + 10; info_height = 2*iheight + 4;
x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2; x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;
y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height + info_height)) / 2; y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height + info_height)) / 2;