mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 00:11:14 +02:00
* CImageInfo: Scroll license text if text box too small
This commit is contained in:
@@ -59,6 +59,7 @@ CImageInfo::CImageInfo(): config ('\t')
|
||||
void CImageInfo::Init(void)
|
||||
{
|
||||
cc_win = NULL;
|
||||
cc_lic = NULL;
|
||||
item_offset = 20;
|
||||
item_top = item_offset;
|
||||
license_txt = "";
|
||||
@@ -73,6 +74,21 @@ CImageInfo::~CImageInfo()
|
||||
delete cc_win;
|
||||
}
|
||||
|
||||
void CImageInfo::ScrollLic(bool scrollDown)
|
||||
{
|
||||
if (cc_lic && (cc_lic->cctext)) {
|
||||
CTextBox* ctb = cc_lic->cctext->getCCItemTextBoxInst();
|
||||
if (ctb) {
|
||||
ctb->enableBackgroundPaint(true);
|
||||
if (scrollDown)
|
||||
ctb->scrollPageDown(1);
|
||||
else
|
||||
ctb->scrollPageUp(1);
|
||||
ctb->enableBackgroundPaint(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int CImageInfo::exec(CMenuTarget* parent, const std::string &)
|
||||
{
|
||||
int res = menu_return::RETURN_REPAINT;
|
||||
@@ -98,6 +114,12 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &)
|
||||
res = menu_return::RETURN_EXIT_ALL;
|
||||
break;
|
||||
}
|
||||
else if ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_page_up)) {
|
||||
ScrollLic(false);
|
||||
}
|
||||
else if ((msg == CRCInput::RC_down) || (msg == CRCInput::RC_page_down)) {
|
||||
ScrollLic(true);
|
||||
}
|
||||
else if (msg <= CRCInput::RC_MaxRC){
|
||||
break;
|
||||
}
|
||||
@@ -271,8 +293,8 @@ void CImageInfo::InitLicenseText()
|
||||
}
|
||||
in.close();
|
||||
|
||||
CComponentsInfoBox *cc_lic = new CComponentsInfoBox(item_offset, item_top, cc_win->getWidth()-2*item_offset, cc_win->getHeight()-item_top);
|
||||
cc_lic->setText(license_txt, CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]);
|
||||
cc_lic = new CComponentsInfoBox(item_offset, item_top, cc_win->getWidth()-2*item_offset, cc_win->getHeight()-item_top);
|
||||
cc_lic->setText(license_txt, CTextBox::AUTO_WIDTH | CTextBox::SCROLL, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]);
|
||||
|
||||
//add text to container
|
||||
cc_win->addCCItem(cc_lic);
|
||||
|
Reference in New Issue
Block a user