mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 07:23:09 +02:00
If more than 8 frontends, scroll window for frontends at boxinfo.
This commit is contained in:
@@ -55,6 +55,8 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
|
CComponentsInfoBox * cc_fe;
|
||||||
|
|
||||||
CDBoxInfoWidget::CDBoxInfoWidget()
|
CDBoxInfoWidget::CDBoxInfoWidget()
|
||||||
{
|
{
|
||||||
fm = g_Font[SNeutrinoSettings::FONT_TYPE_MENU];
|
fm = g_Font[SNeutrinoSettings::FONT_TYPE_MENU];
|
||||||
@@ -68,6 +70,7 @@ CDBoxInfoWidget::CDBoxInfoWidget()
|
|||||||
x = 0;
|
x = 0;
|
||||||
y = 0;
|
y = 0;
|
||||||
header = NULL;
|
header = NULL;
|
||||||
|
cc_fe = NULL;
|
||||||
fontWidth = fm->getWidth();
|
fontWidth = fm->getWidth();
|
||||||
sizeWidth = 6 * fm->getMaxDigitWidth()
|
sizeWidth = 6 * fm->getMaxDigitWidth()
|
||||||
+ fm->getRenderWidth(std::string(" MiB") + g_Locale->getText(LOCALE_UNIT_DECIMAL)); //9999.99 MiB
|
+ fm->getRenderWidth(std::string(" MiB") + g_Locale->getText(LOCALE_UNIT_DECIMAL)); //9999.99 MiB
|
||||||
@@ -81,6 +84,8 @@ CDBoxInfoWidget::~CDBoxInfoWidget()
|
|||||||
{
|
{
|
||||||
delete header;
|
delete header;
|
||||||
header = NULL;
|
header = NULL;
|
||||||
|
delete cc_fe;
|
||||||
|
cc_fe = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &)
|
int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &)
|
||||||
@@ -136,6 +141,18 @@ int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &)
|
|||||||
res = menu_return::RETURN_EXIT_ALL;
|
res = menu_return::RETURN_EXIT_ALL;
|
||||||
doLoop = false;
|
doLoop = false;
|
||||||
}
|
}
|
||||||
|
else if ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_page_up)) {
|
||||||
|
if (cc_fe && (cc_fe->cctext)) {
|
||||||
|
if (cc_fe->cctext->getCTextBoxObject())
|
||||||
|
cc_fe->cctext->getCTextBoxObject()->scrollPageUp(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ((msg == CRCInput::RC_down) || (msg == CRCInput::RC_page_down)) {
|
||||||
|
if (cc_fe && (cc_fe->cctext)) {
|
||||||
|
if (cc_fe->cctext->getCTextBoxObject())
|
||||||
|
cc_fe->cctext->getCTextBoxObject()->scrollPageDown(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (msg == CRCInput::RC_info || msg == CRCInput::RC_help) {
|
else if (msg == CRCInput::RC_info || msg == CRCInput::RC_help) {
|
||||||
upmode = !upmode;
|
upmode = !upmode;
|
||||||
paint();
|
paint();
|
||||||
@@ -222,8 +239,13 @@ void CDBoxInfoWidget::paint()
|
|||||||
height += mheight/2; // space
|
height += mheight/2; // space
|
||||||
|
|
||||||
int frontend_count = CFEManager::getInstance()->getFrontendCount();
|
int frontend_count = CFEManager::getInstance()->getFrontendCount();
|
||||||
|
if (frontend_count > 6)
|
||||||
|
height += mheight * 2;
|
||||||
|
else
|
||||||
if (frontend_count > 2)
|
if (frontend_count > 2)
|
||||||
height += mheight * (frontend_count - 2);
|
height += mheight * (frontend_count - 2) - mheight * 2;
|
||||||
|
// else
|
||||||
|
// height -= mheight;
|
||||||
|
|
||||||
int icon_w = 0, icon_h = 0;
|
int icon_w = 0, icon_h = 0;
|
||||||
frameBuffer->getIconSize(NEUTRINO_ICON_MARKER_RECORD, &icon_w, &icon_h);
|
frameBuffer->getIconSize(NEUTRINO_ICON_MARKER_RECORD, &icon_w, &icon_h);
|
||||||
@@ -467,15 +489,32 @@ void CDBoxInfoWidget::paint()
|
|||||||
|
|
||||||
fm->RenderString(x + 10, ypos + mheight, width - 10, g_Locale->getText(LOCALE_EXTRA_DBOXINFO_FRONTEND), COL_MENUCONTENTINACTIVE_TEXT);
|
fm->RenderString(x + 10, ypos + mheight, width - 10, g_Locale->getText(LOCALE_EXTRA_DBOXINFO_FRONTEND), COL_MENUCONTENTINACTIVE_TEXT);
|
||||||
ypos += mheight;
|
ypos += mheight;
|
||||||
|
|
||||||
|
std::string txt;
|
||||||
|
CComponentsExtTextForm *item = new CComponentsExtTextForm(x + 10, ypos, satWidth + 10, mheight, "", "");
|
||||||
|
// item->setLabelWidthPercent(15);
|
||||||
|
|
||||||
|
int fecount = frontend_count;
|
||||||
|
if (fecount > 6)
|
||||||
|
fecount = 6;
|
||||||
|
if (cc_fe == NULL)
|
||||||
|
cc_fe = new CComponentsInfoBox(x + 10, ypos, satWidth + 10, mheight * fecount);
|
||||||
|
cc_fe->setSpaceOffset(1);
|
||||||
|
|
||||||
for (int i = 0; i < frontend_count; i++) {
|
for (int i = 0; i < frontend_count; i++) {
|
||||||
CFrontend *fe = CFEManager::getInstance()->getFE(i);
|
CFrontend *fe = CFEManager::getInstance()->getFE(i);
|
||||||
if (fe) {
|
if (fe) {
|
||||||
std::string s = to_string(i) + ": " + fe->getName();
|
std::string s = to_string(i) + ": " + fe->getName();
|
||||||
fm->RenderString(x+ 10, ypos+ mheight, width - 10, s, COL_MENUCONTENT_TEXT);
|
txt += s + '\n';
|
||||||
|
if (i < 6)
|
||||||
ypos += mheight;
|
ypos += mheight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cc_fe->setText(txt, CTextBox::TOP | CTextBox::AUTO_WIDTH | CTextBox::SCROLL);
|
||||||
|
cc_fe->doPaintTextBoxBg(true);
|
||||||
|
cc_fe->paint(true);
|
||||||
|
|
||||||
ypos = std::max(ypos, ypos_mem);
|
ypos = std::max(ypos, ypos_mem);
|
||||||
ypos += mheight/2;
|
ypos += mheight/2;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user