mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
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:
@@ -123,6 +123,7 @@ void CBEBouquetWidget::paint()
|
||||
float sbh= (sb- 4)/ sbc;
|
||||
int sbs= (selected/listmaxshow);
|
||||
|
||||
//scrollbar
|
||||
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);
|
||||
|
||||
int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth();
|
||||
int fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight();
|
||||
width = w_max (64 * fw, 20);
|
||||
height = h_max (20 * fh, 50);
|
||||
width = w_max ((frameBuffer->getScreenWidth() / 20 * (fw+6)), 100);
|
||||
height = h_max ((frameBuffer->getScreenHeight() / 20 * 18), (frameBuffer->getScreenHeight() / 20 * 2));
|
||||
listmaxshow = (height-theight-0)/iheight;
|
||||
height = theight+0+listmaxshow*iheight; // recalc height
|
||||
x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;
|
||||
|
@@ -84,7 +84,7 @@ CBEChannelWidget::CBEChannelWidget(const std::string & Caption, unsigned int Bou
|
||||
bouquet = Bouquet;
|
||||
mode = CZapitClient::MODE_TV;
|
||||
dline = NULL;
|
||||
ibox = new CComponentsInfoBox();
|
||||
ibox = NULL;
|
||||
Channels = NULL;
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ void CBEChannelWidget::paintDetails(int index)
|
||||
|
||||
//info box
|
||||
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*/)
|
||||
@@ -235,7 +235,12 @@ void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/)
|
||||
dline->setYPos(ypos1a);
|
||||
|
||||
//infobox
|
||||
if (ibox){
|
||||
if (ibox == NULL)
|
||||
ibox = new CComponentsInfoBox();
|
||||
|
||||
if (ibox->isPainted())
|
||||
ibox->hide(CC_SAVE_SCREEN_NO);
|
||||
|
||||
ibox->setDimensionsAll(x, ypos2, width, info_height);
|
||||
ibox->setFrameThickness(2);
|
||||
#if 0
|
||||
@@ -245,7 +250,6 @@ void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/)
|
||||
ibox->setShadowOnOff(CC_SHADOW_OFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CBEChannelWidget::clearItem2DetailsLine()
|
||||
{
|
||||
@@ -295,10 +299,10 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey*
|
||||
|
||||
int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth();
|
||||
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;
|
||||
height = theight+footerHeight+listmaxshow*iheight; // recalc height
|
||||
info_height = 2*iheight + 10;
|
||||
info_height = 2*iheight + 4;
|
||||
|
||||
x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;
|
||||
y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height + info_height)) / 2;
|
||||
|
@@ -164,10 +164,10 @@ int CBEChannelSelectWidget::exec(CMenuTarget* parent, const std::string & action
|
||||
{
|
||||
int fw = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getWidth();
|
||||
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;
|
||||
height = theight+footerHeight+listmaxshow*iheight; // recalc height
|
||||
info_height = 2*iheight + 10;
|
||||
info_height = 2*iheight + 4;
|
||||
|
||||
x = frameBuffer->getScreenX() + (frameBuffer->getScreenWidth() - width) / 2;
|
||||
y = frameBuffer->getScreenY() + (frameBuffer->getScreenHeight() - (height + info_height)) / 2;
|
||||
|
Reference in New Issue
Block a user