mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 23:42:51 +02:00
Enable gradient for all remaining GUI header
Origin commit data
------------------
Commit: b9400110b4
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-10-16 (Thu, 16 Oct 2014)
This commit is contained in:
@@ -445,6 +445,7 @@ bool CEpgData::isCurrentEPG(const t_channel_id channel_id)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop, bool callFromfollowlist )
|
||||
{
|
||||
int res = menu_return::RETURN_REPAINT;
|
||||
@@ -455,6 +456,10 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
|
||||
startzeit=*a_startzeit;
|
||||
id=a_id;
|
||||
|
||||
CComponentsHeader* header = NULL;
|
||||
CComponentsPicture* headerPic = NULL;
|
||||
CComponentsText* headerText = NULL;
|
||||
|
||||
int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight();
|
||||
|
||||
GetEPGData(channel_id, id, &startzeit );
|
||||
@@ -486,8 +491,9 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
|
||||
CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(channel_id);
|
||||
if(channel) {
|
||||
if(g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(channel_id, channel->getName(), lname, &logo_w, &logo_h)) {
|
||||
if((logo_h > toph) || (logo_w > logo_w_max))
|
||||
g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, toph);
|
||||
if((logo_h > (toph-4)) || (logo_w > logo_w_max)) {
|
||||
g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, toph-4);
|
||||
}
|
||||
pic_offx = logo_w + 10;
|
||||
}
|
||||
}
|
||||
@@ -620,21 +626,25 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
|
||||
has_follow_screenings = true;
|
||||
}
|
||||
|
||||
|
||||
COSDFader fader(g_settings.theme.menu_Content_alpha);
|
||||
fader.StartFadeIn();
|
||||
|
||||
//show the epg
|
||||
frameBuffer->paintBoxRel(sx, sy, ox, toph, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);
|
||||
|
||||
//show the logo
|
||||
if (pic_offx > 0)
|
||||
g_PicViewer->DisplayImage(lname, sx+10, sy + (toph-logo_h)/2, logo_w, logo_h);
|
||||
|
||||
//show the title
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->RenderString(sx+15 + pic_offx, sy + topheight+ 3, ox-15- pic_offx, text1, COL_MENUHEAD_TEXT);
|
||||
if (!(text2.empty()))
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->RenderString(sx+15+ pic_offx, sy+ 2* topheight+ 3, ox-15 - pic_offx, text2, COL_MENUHEAD_TEXT);
|
||||
// header + logo
|
||||
int header_h = std::max(toph, logo_h);
|
||||
header = new CComponentsHeader(sx, sy, ox, header_h);
|
||||
if (pic_offx > 0) {
|
||||
headerPic = new CComponentsPicture(sx+10, sy + (toph-logo_h)/2, logo_w, logo_h, lname);
|
||||
headerPic->doPaintBg(false);
|
||||
}
|
||||
std::string textAll = (text2 != "") ? text1 + "\n" + text2 : text1;
|
||||
headerText = new CComponentsText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]);
|
||||
headerText->doPaintBg(false);
|
||||
headerText->setTextColor(COL_MENUHEAD_TEXT);
|
||||
header->paint(CC_SAVE_SCREEN_NO);
|
||||
headerText->paint(CC_SAVE_SCREEN_NO);
|
||||
if (headerPic)
|
||||
headerPic->paint(CC_SAVE_SCREEN_NO);
|
||||
|
||||
//show date-time....
|
||||
frameBuffer->paintBoxRel(sx, sy+oy-botboxheight, ox, botboxheight, COL_MENUHEAD_PLUS_0);
|
||||
@@ -974,6 +984,13 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
|
||||
hide();
|
||||
fader.StopFade();
|
||||
}
|
||||
if (headerPic)
|
||||
delete headerPic;
|
||||
if (headerText)
|
||||
delete headerText;
|
||||
if (header)
|
||||
delete header;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@@ -844,54 +844,71 @@ void CNeutrinoEventList::paintDescription(int index)
|
||||
|
||||
void CNeutrinoEventList::paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev, std::string _channelname_next)
|
||||
{
|
||||
frameBuffer->paintBoxRel(x,y, full_width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);
|
||||
CComponentsHeader* header = NULL;
|
||||
CComponentsChannelLogo* midLogo = NULL;
|
||||
CComponentsText* midText = NULL;
|
||||
CComponentsText* lText = NULL;
|
||||
CComponentsText* rText = NULL;
|
||||
|
||||
bool logo_ok = false;
|
||||
std::string lname;
|
||||
int font_mid = SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE;
|
||||
int font_lr = SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE;
|
||||
|
||||
header = new CComponentsHeader(x, y, full_width, theight);
|
||||
header->paint(CC_SAVE_SCREEN_NO);
|
||||
|
||||
int logo_w_max = full_width / 4;
|
||||
int name_w = 0;
|
||||
int logo_w = 0;
|
||||
int logo_h = 0;
|
||||
int x_off = 10;
|
||||
int y_off = std::max((theight - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getHeight()) / 2, 0);
|
||||
int y_off = std::max((theight - g_Font[font_lr]->getHeight()) / 2, 0);
|
||||
int x_pos = x;
|
||||
int y_pos = y;
|
||||
int mid_width = full_width * 40 / 100; // 40%
|
||||
int side_width = ((full_width - mid_width) / 2) - (2 * x_off);
|
||||
|
||||
if(g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(_channel_id, _channelname, lname, &logo_w, &logo_h)){
|
||||
if((logo_h > theight) || (logo_w > mid_width))
|
||||
g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, mid_width, theight);
|
||||
x_pos = x + (full_width-logo_w)/2;
|
||||
y_pos = y + (theight-logo_h)/2;
|
||||
logo_ok = g_PicViewer->DisplayImage(lname, x_pos, y_pos, logo_w, logo_h);
|
||||
}
|
||||
|
||||
if (!logo_ok) {
|
||||
name_w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getRenderWidth(_channelname);
|
||||
x_pos = x + (full_width - std::min(name_w, mid_width))/2;
|
||||
y_pos = y + theight;
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->RenderString(x_pos, y_pos, mid_width, _channelname.c_str(), COL_MENUHEAD_TEXT);
|
||||
}
|
||||
else
|
||||
{
|
||||
midLogo = new CComponentsChannelLogo(0, 0, logo_w_max, theight, _channelname, _channel_id);
|
||||
if (midLogo->hasLogo()) {
|
||||
int logo_w = midLogo->getWidth();
|
||||
midLogo->setXPos(x + (full_width - logo_w) / 2);
|
||||
midLogo->setYPos(y + (theight - midLogo->getHeight()) / 2);
|
||||
midLogo->paint();
|
||||
// recalc widths
|
||||
mid_width = logo_w;
|
||||
side_width = ((full_width - mid_width) / 2) - (4 * x_off);
|
||||
}
|
||||
else {
|
||||
name_w = g_Font[font_mid]->getRenderWidth(_channelname);
|
||||
x_pos = x + (full_width - std::min(name_w, mid_width))/2;
|
||||
y_pos = y;
|
||||
midText = new CComponentsText(x_pos, y_pos, mid_width, theight, _channelname, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_mid]);
|
||||
midText->doPaintBg(false);
|
||||
midText->setTextColor(COL_MENUHEAD_TEXT);
|
||||
midText->paint(CC_SAVE_SCREEN_NO);
|
||||
}
|
||||
|
||||
if (!_channelname_prev.empty()) {
|
||||
//name_w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getRenderWidth(_channelname_prev);
|
||||
x_pos = x + x_off;
|
||||
y_pos = y + theight - y_off;
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x_pos, y_pos, side_width, _channelname_prev.c_str(), COL_MENUHEAD_TEXT);
|
||||
y_pos = y + y_off;
|
||||
lText = new CComponentsText(x_pos, y_pos, side_width, theight, _channelname_prev, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr]);
|
||||
lText->doPaintBg(false);
|
||||
lText->setTextColor(COL_MENUHEAD_TEXT);
|
||||
lText->paint(CC_SAVE_SCREEN_NO);
|
||||
}
|
||||
|
||||
if (!_channelname_next.empty()) {
|
||||
name_w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getRenderWidth(_channelname_next);
|
||||
name_w = g_Font[font_lr]->getRenderWidth(_channelname_next);
|
||||
x_pos = x + full_width - std::min(name_w, side_width) - x_off;
|
||||
y_pos = y + theight - y_off;
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x_pos, y_pos, std::min(name_w, side_width), _channelname_next.c_str(), COL_MENUHEAD_TEXT);
|
||||
y_pos = y + y_off;
|
||||
rText = new CComponentsText(x_pos, y_pos, std::min(name_w, side_width), theight, _channelname_next, CTextBox::NO_AUTO_LINEBREAK, g_Font[font_lr]);
|
||||
rText->doPaintBg(false);
|
||||
rText->setTextColor(COL_MENUHEAD_TEXT);
|
||||
rText->paint(CC_SAVE_SCREEN_NO);
|
||||
}
|
||||
|
||||
if (rText) delete rText;
|
||||
if (lText) delete lText;
|
||||
if (midText) delete midText;
|
||||
if (midLogo) delete midLogo;
|
||||
if (header) delete header;
|
||||
}
|
||||
|
||||
void CNeutrinoEventList::paint(t_channel_id channel_id)
|
||||
|
@@ -167,6 +167,10 @@ void CHintBox::refresh(void)
|
||||
window->paintBoxRel(width - 20, borderwidth, borderwidth + 20, height - borderwidth - 20, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_TOP); // right
|
||||
window->paintBoxRel(borderwidth, height-20, width, borderwidth+20, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); // bottom
|
||||
|
||||
CComponentsHeader header(window->x, window->y, width, theight, caption, iconfile);
|
||||
header.paint(CC_SAVE_SCREEN_NO);
|
||||
|
||||
#if 0
|
||||
//window->paintBoxRel(0, 0, width, theight, (CFBWindow::color_t)COL_MENUHEAD_PLUS_0);
|
||||
window->paintBoxRel(0, 0, width, theight, (CFBWindow::color_t)COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round
|
||||
|
||||
@@ -181,7 +185,7 @@ void CHintBox::refresh(void)
|
||||
}
|
||||
else
|
||||
window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], 10, theight, width - 10, caption, COL_MENUHEAD_TEXT);
|
||||
|
||||
#endif
|
||||
//window->paintBoxRel(0, theight, width, (entries_per_page + 1) * fheight, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0);
|
||||
window->paintBoxRel(0, theight, width, (entries_per_page + 1) * fheight, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);//round
|
||||
|
||||
|
@@ -274,7 +274,11 @@ void CHintBoxExt::refresh(bool toround)
|
||||
m_window->paintBoxRel(SHADOW_OFFSET, SHADOW_OFFSET, m_width, m_height, COL_INFOBAR_SHADOW_PLUS_0, RADIUS_LARGE, toround ? CORNER_ALL : CORNER_BOTTOM | CORNER_TOP_RIGHT);
|
||||
bgPainted = true;
|
||||
}
|
||||
|
||||
|
||||
std::string title_text = (m_caption == NONEXISTANT_LOCALE) ? m_captionString : g_Locale->getText(m_caption);
|
||||
CComponentsHeader header(m_window->x, m_window->y, m_width, m_theight, title_text, m_iconfile);
|
||||
header.paint(CC_SAVE_SCREEN_NO);
|
||||
#if 0
|
||||
// title bar
|
||||
m_window->paintBoxRel(0, 0, m_width, m_theight, (CFBWindow::color_t)COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round
|
||||
|
||||
@@ -296,7 +300,7 @@ void CHintBoxExt::refresh(bool toround)
|
||||
|
||||
// title text
|
||||
m_window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE], x_text, m_theight, m_width, title_text, COL_MENUHEAD_TEXT);
|
||||
|
||||
#endif
|
||||
// background of text panel
|
||||
m_window->paintBoxRel(0, m_theight, m_width, (m_maxEntriesPerPage + 1) * m_fheight, (CFBWindow::color_t)COL_MENUCONTENT_PLUS_0, toround ? RADIUS_LARGE : 0, CORNER_BOTTOM);//round
|
||||
|
||||
|
@@ -173,10 +173,10 @@ void CKeyChooserItem::paint()
|
||||
|
||||
//frameBuffer->paintBoxRel(x, y , width, hheight , COL_MENUHEAD_PLUS_0 );
|
||||
//frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0);
|
||||
frameBuffer->paintBoxRel(x, y , width, hheight , COL_MENUHEAD_PLUS_0 , RADIUS_LARGE, CORNER_TOP);//round
|
||||
frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);//round
|
||||
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ 10, y+ hheight, width, g_Locale->getText(name), COL_MENUHEAD_TEXT);
|
||||
CComponentsHeader header(x, y, width, hheight, g_Locale->getText(name));
|
||||
header.paint(CC_SAVE_SCREEN_NO);
|
||||
|
||||
//paint msg...
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, y+ hheight+ mheight, width, g_Locale->getText(LOCALE_KEYCHOOSER_TEXT1), COL_MENUCONTENT_TEXT);
|
||||
|
@@ -82,9 +82,8 @@ void CListBox::paint()
|
||||
|
||||
void CListBox::paintHead()
|
||||
{
|
||||
//frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0);
|
||||
frameBuffer->paintBoxRel(x, y, width, theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width, caption.c_str() , COL_MENUHEAD_TEXT);
|
||||
CComponentsHeader header(x, y, width, theight, caption);
|
||||
header.paint(CC_SAVE_SCREEN_NO);
|
||||
}
|
||||
|
||||
void CListBox::paintFoot()
|
||||
|
@@ -423,6 +423,12 @@ void CMsgBox::refreshTitle(void)
|
||||
// first check if title is configured
|
||||
if( !(m_nMode & TITLE)) return;
|
||||
|
||||
CComponentsHeader header(m_cBoxFrameTitleRel.iX+m_cBoxFrame.iX,
|
||||
m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY,
|
||||
m_cBoxFrameTitleRel.iWidth,
|
||||
m_cBoxFrameTitleRel.iHeight, m_cTitle, m_cIcon);
|
||||
header.paint(CC_SAVE_SCREEN_NO);
|
||||
#if 0
|
||||
// draw the background
|
||||
m_pcWindow->paintBoxRel( m_cBoxFrameTitleRel.iX+m_cBoxFrame.iX,
|
||||
m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY,
|
||||
@@ -454,6 +460,7 @@ void CMsgBox::refreshTitle(void)
|
||||
m_cTitle.c_str(),
|
||||
COL_MENUHEAD_TEXT);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
@@ -545,18 +545,10 @@ void CStringInput::hide()
|
||||
void CStringInput::paint(bool sms)
|
||||
{
|
||||
frameBuffer->paintBoxRel(x + SHADOW_OFFSET, y + SHADOW_OFFSET, width, height, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE, CORNER_ALL); //round
|
||||
frameBuffer->paintBoxRel(x, y, width, hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); //round
|
||||
frameBuffer->paintBoxRel(x, y + hheight, width, bheight, COL_MENUCONTENT_PLUS_0, sms ? 0 : RADIUS_LARGE, CORNER_BOTTOM);
|
||||
|
||||
int icol_w = 0, icol_h = 0, icol_o = 0;
|
||||
if (!(iconfile.empty()))
|
||||
{
|
||||
frameBuffer->getIconSize(iconfile.c_str(), &icol_w, &icol_h);
|
||||
frameBuffer->paintIcon(iconfile, x + (offset/2), y, hheight);
|
||||
icol_o = icol_w + (offset/2);
|
||||
}
|
||||
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ (offset/2)+ icol_o, y+ hheight, width- offset- icol_o, head.c_str(), COL_MENUHEAD_TEXT);
|
||||
CComponentsHeader header(x, y, width, hheight, head, iconfile);
|
||||
header.paint(CC_SAVE_SCREEN_NO);
|
||||
|
||||
int tmp_y = y+ hheight+ offset+ input_h+ offset;
|
||||
if ((hint_1 != NONEXISTANT_LOCALE) || (hint_2 != NONEXISTANT_LOCALE))
|
||||
@@ -574,7 +566,8 @@ void CStringInput::paint(bool sms)
|
||||
tmp_y += offset;
|
||||
}
|
||||
|
||||
icol_w = icol_h = 0;
|
||||
int icol_w = 0;
|
||||
int icol_h = 0;
|
||||
if (sms)
|
||||
{
|
||||
frameBuffer->getIconSize(NEUTRINO_ICON_NUMERIC_PAD, &icol_w, &icol_h);
|
||||
|
@@ -290,10 +290,10 @@ void CExtendedInput::hide()
|
||||
|
||||
void CExtendedInput::paint()
|
||||
{
|
||||
frameBuffer->paintBoxRel(x, y, width, hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);
|
||||
frameBuffer->paintBoxRel(x, y + hheight, width, bheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);
|
||||
CComponentsHeader header(x, y, width, hheight, g_Locale->getText(name));
|
||||
header.paint(CC_SAVE_SCREEN_NO);
|
||||
|
||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+ (offset/2), y+ hheight, width- offset, g_Locale->getText(name), COL_MENUHEAD_TEXT);
|
||||
frameBuffer->paintBoxRel(x, y + hheight, width, bheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);
|
||||
|
||||
int tmp_y = y+ hheight+ offset+ input_h+ offset;
|
||||
|
||||
|
Reference in New Issue
Block a user