mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
- channellist.cpp: rework header and buttonbar
* paint channellogo in mini-tv-mode * strech the positions of right elements in header marginally * paint buttonbar over the full width
This commit is contained in:
@@ -512,7 +512,7 @@ void CChannelList::calcSize()
|
|||||||
infozone_width = widthDetails - width;
|
infozone_width = widthDetails - width;
|
||||||
pig_width = infozone_width;
|
pig_width = infozone_width;
|
||||||
pig_height = (pig_width * 9) / 16;
|
pig_height = (pig_width * 9) / 16;
|
||||||
infozone_height = height - theight - pig_height;
|
infozone_height = height - theight - pig_height - footerHeight;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -572,7 +572,7 @@ int CChannelList::show()
|
|||||||
|
|
||||||
if (g_settings.channellist_minitv)
|
if (g_settings.channellist_minitv)
|
||||||
{
|
{
|
||||||
frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,pig_height+infozone_height,COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);
|
frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,pig_height+infozone_height,COL_MENUCONTENT_PLUS_0);
|
||||||
}
|
}
|
||||||
|
|
||||||
paintHead();
|
paintHead();
|
||||||
@@ -1629,19 +1629,17 @@ void CChannelList::paintItem2DetailsLine (int pos, int /*ch_index*/)
|
|||||||
|
|
||||||
void CChannelList::showChannelLogo()
|
void CChannelList::showChannelLogo()
|
||||||
{
|
{
|
||||||
if (g_settings.channellist_minitv)
|
|
||||||
return;
|
|
||||||
if(g_settings.infobar_show_channellogo){
|
if(g_settings.infobar_show_channellogo){
|
||||||
static int logo_w = 0;
|
static int logo_w = 0;
|
||||||
static int logo_h = 0;
|
static int logo_h = 0;
|
||||||
int logo_w_max = width / 4;
|
int logo_w_max = widthDetails / 4;
|
||||||
frameBuffer->paintBoxRel(x + width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h, COL_MENUHEAD_PLUS_0);
|
frameBuffer->paintBoxRel(x + widthDetails - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h, COL_MENUHEAD_PLUS_0);
|
||||||
|
|
||||||
std::string lname;
|
std::string lname;
|
||||||
if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->getName(), lname, &logo_w, &logo_h)) {
|
if(g_PicViewer->GetLogoName(chanlist[selected]->channel_id, chanlist[selected]->getName(), lname, &logo_w, &logo_h)) {
|
||||||
if((logo_h > theight) || (logo_w > logo_w_max))
|
if((logo_h > theight) || (logo_w > logo_w_max))
|
||||||
g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, theight);
|
g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, theight);
|
||||||
g_PicViewer->DisplayImage(lname, x + width - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h);
|
g_PicViewer->DisplayImage(lname, x + widthDetails - logo_off - logo_w, y+(theight-logo_h)/2, logo_w, logo_h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1730,7 +1728,7 @@ void CChannelList::paintButtonBar(bool is_current)
|
|||||||
|
|
||||||
//paint buttons
|
//paint buttons
|
||||||
int y_foot = y + (height - footerHeight);
|
int y_foot = y + (height - footerHeight);
|
||||||
::paintButtons(x, y_foot, width,num_buttons, Button, footerHeight,0,false,COL_INFOBAR_SHADOW,NULL,0,true, buttonID_rest);
|
::paintButtons(x, y_foot, widthDetails,num_buttons, Button, footerHeight,0,false,COL_INFOBAR_SHADOW,NULL,0,true, buttonID_rest);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CChannelList::paintItem(int pos)
|
void CChannelList::paintItem(int pos)
|
||||||
@@ -1957,6 +1955,7 @@ void CChannelList::paintHead()
|
|||||||
char timestr[10] = {0};
|
char timestr[10] = {0};
|
||||||
time_t now = time(NULL);
|
time_t now = time(NULL);
|
||||||
struct tm *tm = localtime(&now);
|
struct tm *tm = localtime(&now);
|
||||||
|
|
||||||
bool gotTime = g_Sectionsd->getIsTimeSet();
|
bool gotTime = g_Sectionsd->getIsTimeSet();
|
||||||
|
|
||||||
if(gotTime) {
|
if(gotTime) {
|
||||||
@@ -1973,28 +1972,24 @@ void CChannelList::paintHead()
|
|||||||
// head
|
// head
|
||||||
frameBuffer->paintBoxRel(x,y, widthDetails,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round
|
frameBuffer->paintBoxRel(x,y, widthDetails,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);//round
|
||||||
|
|
||||||
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + width - iw1 - 4, y, theight); //y+ 5 );
|
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x + widthDetails - iw1 - 10, y, theight); //y+ 5 );
|
||||||
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + width - iw1 - iw2 - 8, y, theight);//y + 5); // icon for bouquet list button
|
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, x + widthDetails - iw1 - iw2 - 14, y, theight);//y + 5); // icon for bouquet list button
|
||||||
if (g_settings.channellist_new_zap_mode)
|
if (g_settings.channellist_new_zap_mode)
|
||||||
frameBuffer->paintIcon(this->new_mode_active ?
|
frameBuffer->paintIcon(this->new_mode_active ?
|
||||||
NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE,
|
NEUTRINO_ICON_BUTTON_MUTE_ZAP_ACTIVE : NEUTRINO_ICON_BUTTON_MUTE_ZAP_INACTIVE,
|
||||||
x + width - iw1 - iw2 - iw3 - 12, y, theight);
|
x + widthDetails - iw1 - iw2 - iw3 - 18, y, theight);
|
||||||
|
|
||||||
if (gotTime) {
|
if (gotTime) {
|
||||||
int iw3x = (g_settings.channellist_new_zap_mode) ? iw3 : -4;
|
int iw3x = (g_settings.channellist_new_zap_mode) ? iw3 : -4;
|
||||||
if (g_settings.channellist_minitv)
|
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + widthDetails - iw1 - iw2 - iw3x - 28 -timestr_len,
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + widthDetails - 16 -timestr_len,
|
|
||||||
y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8
|
|
||||||
else
|
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x + width - iw1 - iw2 - iw3x - 16 -timestr_len,
|
|
||||||
y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8
|
y+theight, timestr_len, timestr, COL_MENUHEAD, 0, true); // UTF-8
|
||||||
timestr_len += 4;
|
timestr_len += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
timestr_len += iw1 + iw2 + 12;
|
timestr_len += iw1 + iw2 + 12;
|
||||||
if (g_settings.channellist_new_zap_mode)
|
if (g_settings.channellist_new_zap_mode)
|
||||||
timestr_len += iw3 + 4;
|
timestr_len += iw3 + 10;
|
||||||
logo_off = timestr_len + 4;
|
logo_off = timestr_len + 10;
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, widthDetails - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8
|
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, widthDetails - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2099,7 +2094,7 @@ void CChannelList::paint_pig (int _x, int _y, int w, int h)
|
|||||||
void CChannelList::paint_events(int index)
|
void CChannelList::paint_events(int index)
|
||||||
{
|
{
|
||||||
readEvents(chanlist[index]->channel_id);
|
readEvents(chanlist[index]->channel_id);
|
||||||
frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);
|
frameBuffer->paintBoxRel(x+ width,y+ theight+pig_height, infozone_width, infozone_height,COL_MENUCONTENT_PLUS_0);
|
||||||
|
|
||||||
char text1[10];
|
char text1[10];
|
||||||
CChannelEventList::iterator e;
|
CChannelEventList::iterator e;
|
||||||
@@ -2140,7 +2135,7 @@ void CChannelList::paint_events(int index)
|
|||||||
strftime(text1, sizeof(text1), "%H:%M", tmStartZeit );
|
strftime(text1, sizeof(text1), "%H:%M", tmStartZeit );
|
||||||
//printf("%s %s\n", text1, e->description.c_str());
|
//printf("%s %s\n", text1, e->description.c_str());
|
||||||
int timewidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(text1, true);
|
int timewidth = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getRenderWidth(text1, true);
|
||||||
if ((y+ theight+ pig_height + i*ffheight) < (y+ height))
|
if ((y+ theight+ pig_height + i*ffheight) < (y+ theight+ pig_height + infozone_height))
|
||||||
{
|
{
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, timewidth, text1, COL_MENUCONTENTDARK, 0, true);
|
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5, y+ theight+ pig_height + i*ffheight, timewidth, text1, COL_MENUCONTENTDARK, 0, true);
|
||||||
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, infozone_width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true);
|
g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->RenderString(x+ width+5+timewidth+5, y+ theight+ pig_height + i*ffheight, infozone_width - timewidth - 20, e->description, COL_MENUCONTENTDARK, 0, true);
|
||||||
|
Reference in New Issue
Block a user