eventlist: small design reworks ...

* rename some variables and functions
* small cleanups
* add shadow to gui-elements; need more fixes

FIXME: progressbar (painted by paintItem()) isn't displayed


Origin commit data
------------------
Commit: 7160d47850
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-06-19 (Mon, 19 Jun 2017)

Origin message was:
------------------
- eventlist: small design reworks ...

* rename some variables and functions
* small cleanups
* add shadow to gui-elements; need more fixes

FIXME: progressbar (painted by paintItem()) isn't displayed
This commit is contained in:
vanhofen
2017-06-19 22:38:39 +02:00
parent e259a9dd07
commit 37cbe5ff7a
2 changed files with 151 additions and 168 deletions

View File

@@ -110,18 +110,17 @@ CEventList::CEventList()
m_search_fsk = 1; m_search_fsk = 1;
full_width = width = 0; full_width = width = 0;
height = 0; height = 0;
x = y = 0; x = y = 0;
cc_infozone = NULL; infozone = NULL;
infozone_text = ""; infozone_text = "";
item_event_ID = 0; item_event_ID = 0;
oldIndex = -1; oldIndex = -1;
oldEventID = -1; oldEventID = -1;
bgRightBoxPaint = false; infozone_background = false;
header = NULL; header = NULL;
pb = NULL; pb = NULL;
Bottombox = NULL; navibar = NULL;
} }
CEventList::~CEventList() CEventList::~CEventList()
@@ -134,8 +133,8 @@ void CEventList::ResetModules()
if (header){ if (header){
delete header; header = NULL; delete header; header = NULL;
} }
if (Bottombox){ if (navibar){
delete Bottombox; Bottombox = NULL; delete navibar; navibar = NULL;
} }
if (pb){ if (pb){
delete pb; pb = NULL; delete pb; pb = NULL;
@@ -318,38 +317,33 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
width = full_width; width = full_width;
height = frameBuffer->getScreenHeightRel(); height = frameBuffer->getScreenHeightRel();
// Calculate iheight (we assume the red button is the largest one?) // Calculate header_height
struct button_label tmp_button[1] = { { NEUTRINO_ICON_BUTTON_RED, LOCALE_EVENTLISTBAR_RECORDEVENT } }; header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); //NI
iheight = ::paintButtons(0, 0, 0, 1, tmp_button, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); footer_height = header_height;
// Calculate theight
theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); //NI
const int pic_h = 39; const int pic_h = 39;
theight = std::max(theight, pic_h); header_height = std::max(header_height, pic_h);
fheight1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getHeight(); largefont_height = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getHeight();
{ {
int h1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getHeight(); int h1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getHeight();
int h2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getHeight(); int h2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getHeight();
fheight2 = std::max( h1, h2 ); smallfont_height = std::max(h1, h2);
} }
unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE);
fheight = fheight1 + fheight2 + OFFSET_INNER_MIN; item_height = smallfont_height + OFFSET_INNER_MIN + largefont_height;
fwidth1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth("DDD, :, ") + 4 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getMaxDigitWidth();
//fwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth("[ ] ") + 3 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getMaxDigitWidth() + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(unit_short_minute);
botboxheight = fheight1+2*OFFSET_INNER_MIN; navibar_height = largefont_height+2*OFFSET_INNER_MIN;
listmaxshow = (height-theight-iheight-botboxheight-0)/fheight; listmaxshow = (height - header_height - footer_height - OFFSET_SHADOW - navibar_height)/item_height;
height = theight+iheight+botboxheight+0+listmaxshow*fheight; // recalc height height = header_height + footer_height + OFFSET_SHADOW + navibar_height + listmaxshow*item_height; // recalc height
y = getScreenStartY(height); y = getScreenStartY(height);
// calculate width of right info_zone // calculate width of right info_zone
infozone_width = full_width - width; infozone_width = full_width - width;
// init right info_zone // init right info_zone
if ((g_settings.eventlist_additional) && (cc_infozone == NULL)) if ((g_settings.eventlist_additional) && (infozone == NULL))
cc_infozone = new CComponentsText(x+width+OFFSET_INNER_MID, y+theight, infozone_width-2*OFFSET_INNER_MID, listmaxshow*fheight); infozone = new CComponentsText(x+width+OFFSET_INNER_MID, y + header_height, infozone_width-2*OFFSET_INNER_MID, listmaxshow*item_height);
int res = menu_return::RETURN_REPAINT; int res = menu_return::RETURN_REPAINT;
//printf("CEventList::exec: channel_id %llx\n", channel_id); //printf("CEventList::exec: channel_id %llx\n", channel_id);
@@ -381,7 +375,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
bool dont_hide = false; bool dont_hide = false;
paintHead(channel_id, channelname, channelname_prev, channelname_next); paintHead(channel_id, channelname, channelname_prev, channelname_next);
paint(channel_id); paint(channel_id);
showFunctionBar(channel_id); paintFoot(channel_id);
int oldselected = selected; int oldselected = selected;
@@ -428,7 +422,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
else else
paintItem(selected - liststart, channel_id); paintItem(selected - liststart, channel_id);
showFunctionBar(channel_id); paintFoot(channel_id);
} }
//sort //sort
else if (!showfollow && (msg == (neutrino_msg_t)g_settings.key_channelList_sort)) else if (!showfollow && (msg == (neutrino_msg_t)g_settings.key_channelList_sort))
@@ -486,7 +480,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
timerlist.clear(); timerlist.clear();
g_Timerd->getTimerList (timerlist); g_Timerd->getTimerList (timerlist);
paint(evtlist[selected].channelID); paint(evtlist[selected].channelID);
showFunctionBar(evtlist[selected].channelID); paintFoot(evtlist[selected].channelID);
continue; continue;
} }
std::string recDir = g_settings.network_nfs_recordingdir; std::string recDir = g_settings.network_nfs_recordingdir;
@@ -541,7 +535,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
timerlist.clear(); timerlist.clear();
g_Timerd->getTimerList (timerlist); g_Timerd->getTimerList (timerlist);
paint(used_id); paint(used_id);
showFunctionBar(used_id); paintFoot(used_id);
} }
} }
else if ( msg == (neutrino_msg_t) g_settings.key_channelList_addremind )//add/remove zapto timer event else if ( msg == (neutrino_msg_t) g_settings.key_channelList_addremind )//add/remove zapto timer event
@@ -553,7 +547,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
timerlist.clear(); timerlist.clear();
g_Timerd->getTimerList (timerlist); g_Timerd->getTimerList (timerlist);
paint(evtlist[selected].channelID); paint(evtlist[selected].channelID);
showFunctionBar(evtlist[selected].channelID); paintFoot(evtlist[selected].channelID);
continue; continue;
} }
@@ -565,7 +559,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
timerlist.clear(); timerlist.clear();
g_Timerd->getTimerList (timerlist); g_Timerd->getTimerList (timerlist);
paint(evtlist[selected].channelID ); paint(evtlist[selected].channelID );
showFunctionBar(evtlist[selected].channelID ); paintFoot(evtlist[selected].channelID );
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]);
} }
else if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) else if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel)
@@ -576,7 +570,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
paintHead(channel_id, channelname); paintHead(channel_id, channelname);
readEvents(epg_id); readEvents(epg_id);
paint(channel_id); paint(channel_id);
showFunctionBar(channel_id); paintFoot(channel_id);
} else { } else {
selected = oldselected; selected = oldselected;
if(fader.StartFadeOut()) { if(fader.StartFadeOut()) {
@@ -595,7 +589,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
t_channel_id _channel_id = channel_id; t_channel_id _channel_id = channel_id;
getChannelNames(_channel_id, current_channel_name, prev_channel_name, next_channel_name, msg); getChannelNames(_channel_id, current_channel_name, prev_channel_name, next_channel_name, msg);
if(_channel_id){ if(_channel_id){
bgRightBoxPaint = false; infozone_background = false;
loop = false; loop = false;
dont_hide = true; dont_hide = true;
exec(_channel_id, current_channel_name, prev_channel_name, next_channel_name); exec(_channel_id, current_channel_name, prev_channel_name, next_channel_name);
@@ -613,9 +607,9 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
paintHead(channel_id, channelname); paintHead(channel_id, channelname);
oldIndex = -1; oldIndex = -1;
oldEventID = -1; oldEventID = -1;
bgRightBoxPaint = false; infozone_background = false;
paint(channel_id); paint(channel_id);
showFunctionBar(channel_id); paintFoot(channel_id);
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]);
} }
else if (msg == CRCInput::RC_epg) else if (msg == CRCInput::RC_epg)
@@ -656,9 +650,9 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
paintHead(channel_id, in_search ? search_head_name : channelname); paintHead(channel_id, in_search ? search_head_name : channelname);
oldIndex = -1; oldIndex = -1;
oldEventID = -1; oldEventID = -1;
bgRightBoxPaint = false; infozone_background = false;
paint(channel_id); paint(channel_id);
showFunctionBar(channel_id); paintFoot(channel_id);
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]);
} }
} }
@@ -667,7 +661,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
{ {
oldIndex = -1; oldIndex = -1;
oldEventID = -1; oldEventID = -1;
bgRightBoxPaint = false; infozone_background = false;
in_search = findEvents(channel_id, channelname); in_search = findEvents(channel_id, channelname);
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]);
} }
@@ -691,12 +685,12 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
} }
} }
if (cc_infozone) if (infozone)
delete cc_infozone; delete infozone;
cc_infozone = NULL; infozone = NULL;
oldIndex = -1; oldIndex = -1;
oldEventID = -1; oldEventID = -1;
bgRightBoxPaint = false; infozone_background = false;
if(!dont_hide){ if(!dont_hide){
hide(); hide();
@@ -708,7 +702,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna
void CEventList::hide() void CEventList::hide()
{ {
ResetModules(); ResetModules();
frameBuffer->paintBackgroundBoxRel(x,y, full_width,height); frameBuffer->paintBackgroundBoxRel(x, y, full_width + OFFSET_SHADOW, height + OFFSET_SHADOW);
} }
CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChannelEvent * event, int * tID) CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChannelEvent * event, int * tID)
@@ -737,7 +731,7 @@ CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChan
void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI)
{ {
int ypos = y+ theight + pos*fheight; int ypos = y + header_height + pos*item_height;
unsigned int currpos = liststart + pos; unsigned int currpos = liststart + pos;
bool i_selected = currpos == selected; bool i_selected = currpos == selected;
@@ -753,27 +747,27 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI)
i_radius = RADIUS_LARGE; i_radius = RADIUS_LARGE;
if (i_radius) if (i_radius)
frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, fheight, COL_MENUCONTENT_PLUS_0); frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, COL_MENUCONTENT_PLUS_0);
frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, fheight, bgcolor, i_radius); frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, bgcolor, i_radius);
if(currpos<evtlist.size()) if(currpos<evtlist.size())
{ {
std::string datetime1_str, datetime2_str, duration_str; std::string datetime_str, duration_str;
if ( evtlist[currpos].eventID != 0 ) if ( evtlist[currpos].eventID != 0 )
{ {
char tmpstr[256]; char tmpstr[256];
struct tm *tmStartZeit = localtime(&evtlist[currpos].startTime); struct tm *tmStartZeit = localtime(&evtlist[currpos].startTime);
datetime1_str = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); datetime_str = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit));
datetime1_str += strftime(", %H:%M", tmStartZeit); datetime_str += strftime(", %H:%M", tmStartZeit);
datetime1_str += strftime(", %d", tmStartZeit); datetime_str += strftime(", %d", tmStartZeit);
datetime1_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); datetime_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit));
if ( m_showChannel ) // show the channel if we made a event search only (which could be made through all channels ). if ( m_showChannel ) // show the channel if we made a event search only (which could be made through all channels ).
{ {
t_channel_id channel = evtlist[currpos].channelID; t_channel_id channel = evtlist[currpos].channelID;
datetime1_str += " "; datetime_str += " ";
datetime1_str += CServiceManager::getInstance()->GetServiceName(channel); datetime_str += CServiceManager::getInstance()->GetServiceName(channel);
} }
snprintf(tmpstr,sizeof(tmpstr), "[%d %s]", evtlist[currpos].duration / 60, unit_short_minute); snprintf(tmpstr,sizeof(tmpstr), "[%d %s]", evtlist[currpos].duration / 60, unit_short_minute);
@@ -781,10 +775,10 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI)
} }
// 1st line // 1st line
int fwidth1a=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime1_str); int datetime_width = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime_str);
fwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(duration_str); int duration_width = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(duration_str);
g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x + OFFSET_INNER_SMALL, ypos + OFFSET_INNER_MIN + fheight2, fwidth1a, datetime1_str, color); g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x + OFFSET_INNER_SMALL, ypos + OFFSET_INNER_MIN + smallfont_height, datetime_width, datetime_str, color);
int seit = ( evtlist[currpos].startTime - time(NULL) ) / 60; int seit = ( evtlist[currpos].startTime - time(NULL) ) / 60;
if ( (seit> 0) && (seit<100) && (!duration_str.empty()) ) if ( (seit> 0) && (seit<100) && (!duration_str.empty()) )
@@ -792,9 +786,9 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI)
char beginnt[100]; char beginnt[100];
snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute); snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute);
int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt); int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt);
g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - fwidth2 - w, ypos + OFFSET_INNER_MIN + fheight2, w, beginnt, color); g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - duration_width - w, ypos + OFFSET_INNER_MIN + smallfont_height, w, beginnt, color);
} }
g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - fwidth2, ypos + OFFSET_INNER_MIN + fheight2, fwidth2, duration_str, color); g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - duration_width, ypos + OFFSET_INNER_MIN + smallfont_height, duration_width, duration_str, color);
// 2nd line // 2nd line
// set status icons // set status icons
@@ -811,7 +805,7 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI)
int iw = 0, ih = 0; int iw = 0, ih = 0;
if(icontype != 0) { if(icontype != 0) {
frameBuffer->getIconSize(icontype, &iw, &ih); frameBuffer->getIconSize(icontype, &iw, &ih);
frameBuffer->paintIcon(icontype, x + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + fheight2, fheight1); frameBuffer->paintIcon(icontype, x + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + smallfont_height, largefont_height);
iw += OFFSET_INNER_MID; iw += OFFSET_INNER_MID;
} }
@@ -824,15 +818,14 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI)
{ {
//paint_warning = true; //paint_warning = true;
frameBuffer->getIconSize(NEUTRINO_ICON_IMPORTANT, &i2w, &i2h); frameBuffer->getIconSize(NEUTRINO_ICON_IMPORTANT, &i2w, &i2h);
frameBuffer->paintIcon(NEUTRINO_ICON_IMPORTANT, x + iw + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + fheight2, fheight1); frameBuffer->paintIcon(NEUTRINO_ICON_IMPORTANT, x + iw + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + smallfont_height, largefont_height);
iw += i2w + OFFSET_INNER_MID; iw += i2w + OFFSET_INNER_MID;
} }
// paint 2nd line text // paint 2nd line text
g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x + iw + OFFSET_INNER_MID, ypos + fheight, width - iw - 2*OFFSET_INNER_MID, evtlist[currpos].description, color); g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x + iw + OFFSET_INNER_MID, ypos + item_height, width - iw - 2*OFFSET_INNER_MID, evtlist[currpos].description, color);
if (i_radius) showProgressBar(currpos);
showProgressBar(currpos);
} }
} }
@@ -875,11 +868,12 @@ void CEventList::paintDescription(int index)
else else
infozone_text = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); infozone_text = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS);
cc_infozone->setText(infozone_text, CTextBox::TOP, g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_EVENT]); infozone->setText(infozone_text, CTextBox::TOP, g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_EVENT]);
cc_infozone->doPaintBg(false); infozone->doPaintBg(false);
cc_infozone->doPaintTextBoxBg(true); infozone->doPaintTextBoxBg(true);
cc_infozone->forceTextPaint(); //FIXME infozone->enableShadow(CC_SHADOW_RIGHT, -1, true);
cc_infozone->paint(CC_SAVE_SCREEN_NO); infozone->forceTextPaint();
infozone->paint(CC_SAVE_SCREEN_NO);
} }
void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev, std::string _channelname_next) void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev, std::string _channelname_next)
@@ -889,7 +883,8 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s
header->getTextObject()->enableTboxSaveScreen(g_settings.theme.menu_Head_gradient);//enable screen save for title text if color gradient is in use header->getTextObject()->enableTboxSaveScreen(g_settings.theme.menu_Head_gradient);//enable screen save for title text if color gradient is in use
header->enableClock(true, "%H:%M", "%H %M", true); header->enableClock(true, "%H:%M", "%H %M", true);
header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction);
header->setDimensionsAll(x, y, full_width, theight); header->setDimensionsAll(x, y, full_width, header_height);
header->enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true);
} }
//header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); //header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT);
@@ -905,22 +900,27 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s
getChannelNames(_channel_id, _channelname, _channelname_prev, _channelname_next, 0); getChannelNames(_channel_id, _channelname, _channelname_prev, _channelname_next, 0);
} }
paintBottomBox(_channelname_prev, _channelname_next); paintNaviBar(_channelname_prev, _channelname_next);
} }
void CEventList::paintBottomBox(std::string _channelname_prev, std::string _channelname_next) void CEventList::paintNaviBar(std::string _channelname_prev, std::string _channelname_next)
{ {
int by = y + height - iheight - botboxheight; int navibar_y = y + height - OFFSET_SHADOW - footer_height - navibar_height;
if (!Bottombox){ if (!navibar)
Bottombox = new CNaviBar(x, by, full_width, botboxheight); {
Bottombox->setFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); navibar = new CNaviBar(x, navibar_y, full_width, navibar_height);
navibar->setFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]);
//FIXME navibar->enableShadow(CC_SHADOW_RIGHT, -1, true);
} }
Bottombox->enableArrows(!_channelname_prev.empty(), !_channelname_next.empty()); navibar->enableArrows(!_channelname_prev.empty(), !_channelname_next.empty());
Bottombox->setText(_channelname_prev, _channelname_next); navibar->setText(_channelname_prev, _channelname_next);
Bottombox->paint(false); navibar->paint(false);
// shadow
frameBuffer->paintBoxRel(x + full_width, navibar_y + OFFSET_SHADOW, OFFSET_SHADOW, navibar_height, COL_SHADOW_PLUS_0);
} }
void CEventList::showProgressBar(int pos) void CEventList::showProgressBar(int pos)
@@ -935,10 +935,10 @@ void CEventList::showProgressBar(int pos)
if (!pb) if (!pb)
{ {
int pbw = 104; int pbw = full_width/10;
int pbx = x + (full_width - pbw)/2; int pbx = x + (full_width - pbw)/2;
int pbh = botboxheight - 12; int pbh = navibar_height - 2*OFFSET_INNER_SMALL;
int pby = y + height -iheight - botboxheight + (botboxheight - pbh)/2; int pby = y + height - OFFSET_SHADOW - footer_height - navibar_height + (navibar_height - pbh)/2;
pb = new CProgressBar(pbx, pby, pbw, pbh); pb = new CProgressBar(pbx, pby, pbw, pbh);
pb->setType(CProgressBar::PB_TIMESCALE); pb->setType(CProgressBar::PB_TIMESCALE);
@@ -963,12 +963,13 @@ void CEventList::paint(t_channel_id channel_id)
liststart = (selected/listmaxshow)*listmaxshow; liststart = (selected/listmaxshow)*listmaxshow;
// paint background for right box // paint background for right box
if (g_settings.eventlist_additional && !bgRightBoxPaint) { if (g_settings.eventlist_additional && !infozone_background)
frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,listmaxshow*fheight,COL_MENUCONTENT_PLUS_0); {
bgRightBoxPaint = true; frameBuffer->paintBoxRel(x + width,y + header_height, infozone_width, item_height*listmaxshow, COL_MENUCONTENT_PLUS_0);
infozone_background = true;
} }
for(unsigned int count=0;count<listmaxshow;count++) for(unsigned int count=0; count < listmaxshow; count++)
{ {
paintItem(count, channel_id); paintItem(count, channel_id);
} }
@@ -979,16 +980,14 @@ void CEventList::paint(t_channel_id channel_id)
int total_pages; int total_pages;
int current_page; int current_page;
getScrollBarData(&total_pages, &current_page, evtlist.size(), listmaxshow, selected); getScrollBarData(&total_pages, &current_page, evtlist.size(), listmaxshow, selected);
paintScrollBar(x + width - SCROLLBAR_WIDTH, y + theight, SCROLLBAR_WIDTH, fheight*listmaxshow, total_pages, current_page); paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page);
//FIXME shadow
frameBuffer->paintBoxRel(x + full_width, y + header_height + OFFSET_SHADOW, OFFSET_SHADOW, item_height*listmaxshow, COL_SHADOW_PLUS_0);
} }
void CEventList::showFunctionBar(t_channel_id channel_id) void CEventList::paintFoot(t_channel_id channel_id)
{ {
int bx = x;
int bw = full_width;
int bh = iheight;
int by = y + height - bh;
CColorKeyHelper keyhelper; //user_menue.h CColorKeyHelper keyhelper; //user_menue.h
neutrino_msg_t dummy = CRCInput::RC_nokey; neutrino_msg_t dummy = CRCInput::RC_nokey;
const char * icon = NULL; const char * icon = NULL;
@@ -1060,26 +1059,27 @@ void CEventList::showFunctionBar(t_channel_id channel_id)
buttons[btn_cnt].locale = LOCALE_TIMERLIST_NAME; buttons[btn_cnt].locale = LOCALE_TIMERLIST_NAME;
btn_cnt++; btn_cnt++;
::paintButtons(bx, by, bw, btn_cnt, buttons, bw, bh); CComponentsFooter footer;
footer.enableShadow(CC_SHADOW_ON, -1, true);
footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, full_width, footer_height, btn_cnt, buttons);
} }
int CEventListHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/) int CEventListHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/)
{ {
int res = menu_return::RETURN_EXIT_ALL; int res = menu_return::RETURN_EXIT_ALL;
if (parent) {
if (parent)
parent->hide(); parent->hide();
}
CEventList *e = new CEventList; CEventList *e = new CEventList;
CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; CChannelList *channelList = CNeutrinoApp::getInstance()->channelList;
e->exec(CZapit::getInstance()->GetCurrentChannelID(), channelList->getActiveChannelName()); // UTF-8 e->exec(CZapit::getInstance()->GetCurrentChannelID(), channelList->getActiveChannelName());
delete e; delete e;
return res; return res;
} }
/************************************************************************************************/
bool CEventList::findEvents(t_channel_id channel_id, std::string channelname) bool CEventList::findEvents(t_channel_id channel_id, std::string channelname)
/************************************************************************************************/
{ {
bool res = false; bool res = false;
int event = 0; int event = 0;
@@ -1090,19 +1090,19 @@ bool CEventList::findEvents(t_channel_id channel_id, std::string channelname)
m_search_autokeyword = m_search_keyword; m_search_autokeyword = m_search_keyword;
} }
CEventFinderMenu menu( &event, CEventFinderMenu menu(&event,
&m_search_epg_item, &m_search_epg_item,
&m_search_keyword, &m_search_keyword,
&m_search_list, &m_search_list,
&m_search_channel_id, &m_search_channel_id,
&m_search_bouquet_id, &m_search_bouquet_id,
&m_search_genre, &m_search_genre,
&m_search_fsk &m_search_fsk);
);
hide(); hide();
menu.exec(NULL,""); menu.exec(NULL,"");
search_head_name = g_Locale->getText(LOCALE_EVENTFINDER_SEARCH); search_head_name = g_Locale->getText(LOCALE_EVENTFINDER_SEARCH);
if(event == 1) if (event == 1)
{ {
res = true; res = true;
m_showChannel = true; // force the event list to paint the channel name m_showChannel = true; // force the event list to paint the channel name
@@ -1203,16 +1203,15 @@ bool CEventList::findEvents(t_channel_id channel_id, std::string channelname)
} }
} }
if(event) if (event)
paintHead(0, search_head_name); paintHead(0, search_head_name);
else else
paintHead(channel_id, channelname); paintHead(channel_id, channelname);
paint(); paint();
showFunctionBar(channel_id); paintFoot(channel_id);
return(res); return(res);
} }
/************************************************************************************************/
/* /*
class CSearchNotifier : public CChangeObserver class CSearchNotifier : public CChangeObserver
{ {
@@ -1228,7 +1227,7 @@ class CSearchNotifier : public CChangeObserver
} }
}; };
*/ */
/************************************************************************************************ /*
bool CEventFinderMenuHandler::changeNotify(const neutrino_locale_t OptionName, void *Data) bool CEventFinderMenuHandler::changeNotify(const neutrino_locale_t OptionName, void *Data)
{ {
if(OptionName == ) if(OptionName == )
@@ -1286,36 +1285,29 @@ const CMenuOptionChooser::keyval SEARCH_EPG_OPTIONS[SEARCH_EPG_OPTION_COUNT] =
{ CEventList::SEARCH_EPG_ALL, LOCALE_EVENTFINDER_SEARCH_ALL_EPG } { CEventList::SEARCH_EPG_ALL, LOCALE_EVENTFINDER_SEARCH_ALL_EPG }
}; };
CEventFinderMenu::CEventFinderMenu(int* event,
int* search_epg_item,
/************************************************************************************************/ std::string* search_keyword,
CEventFinderMenu::CEventFinderMenu( int* event, int* search_list,
int* search_epg_item, t_channel_id* search_channel_id,
std::string* search_keyword, t_bouquet_id* search_bouquet_id,
int* search_list, int* search_genre,
t_channel_id* search_channel_id, int* search_fsk)
t_bouquet_id* search_bouquet_id,
int* search_genre,
int* search_fsk
)
/************************************************************************************************/
{ {
m_event = event; m_event = event;
m_search_epg_item = search_epg_item; m_search_epg_item = search_epg_item;
m_search_keyword = search_keyword; m_search_keyword = search_keyword;
m_search_list = search_list; m_search_list = search_list;
m_search_channel_id = search_channel_id; m_search_channel_id = search_channel_id;
m_search_bouquet_id = search_bouquet_id; m_search_bouquet_id = search_bouquet_id;
m_search_genre = search_genre; m_search_genre = search_genre;
m_search_fsk = search_fsk; m_search_fsk = search_fsk;
width = 40; width = 40;
selected = -1; selected = -1;
} }
/************************************************************************************************/
int CEventFinderMenu::exec(CMenuTarget* parent, const std::string &actionkey) int CEventFinderMenu::exec(CMenuTarget* parent, const std::string &actionkey)
/************************************************************************************************/
{ {
int res = menu_return::RETURN_REPAINT; int res = menu_return::RETURN_REPAINT;
@@ -1403,9 +1395,7 @@ int CEventFinderMenu::exec(CMenuTarget* parent, const std::string &actionkey)
return res; return res;
} }
/************************************************************************************************/
int CEventFinderMenu::showMenu(void) int CEventFinderMenu::showMenu(void)
/************************************************************************************************/
{ {
int res = menu_return::RETURN_REPAINT; int res = menu_return::RETURN_REPAINT;
m_search_channelname_mf = NULL; m_search_channelname_mf = NULL;
@@ -1469,12 +1459,8 @@ int CEventFinderMenu::showMenu(void)
return(res); return(res);
} }
/************************************************************************************************/
bool CEventFinderMenu::changeNotify(const neutrino_locale_t OptionName, void *) bool CEventFinderMenu::changeNotify(const neutrino_locale_t OptionName, void *)
/************************************************************************************************/
{ {
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST)) if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST))
{ {
if (*m_search_list == CEventList::SEARCH_LIST_CHANNEL) if (*m_search_list == CEventList::SEARCH_LIST_CHANNEL)

View File

@@ -23,7 +23,6 @@
Boston, MA 02110-1301, USA. Boston, MA 02110-1301, USA.
*/ */
#ifndef __EVENTLIST_HPP__ #ifndef __EVENTLIST_HPP__
#define __EVENTLIST_HPP__ #define __EVENTLIST_HPP__
@@ -43,7 +42,6 @@
class CFramebuffer; class CFramebuffer;
class CEventList : public CListHelpers class CEventList : public CListHelpers
{ {
// Eventfinder start
public: public:
typedef enum typedef enum
{ {
@@ -53,14 +51,16 @@ class CEventList : public CListHelpers
SEARCH_EPG_INFO2, SEARCH_EPG_INFO2,
SEARCH_EPG_GENRE, SEARCH_EPG_GENRE,
SEARCH_EPG_ALL SEARCH_EPG_ALL
}SEARCH_EPG; } SEARCH_EPG;
typedef enum typedef enum
{ {
SEARCH_LIST_NONE, SEARCH_LIST_NONE,
SEARCH_LIST_CHANNEL, SEARCH_LIST_CHANNEL,
SEARCH_LIST_BOUQUET, SEARCH_LIST_BOUQUET,
SEARCH_LIST_ALL SEARCH_LIST_ALL
}SEARCH_LIST; } SEARCH_LIST;
private: private:
int m_search_epg_item; int m_search_epg_item;
std::string m_search_keyword; std::string m_search_keyword;
@@ -73,10 +73,8 @@ class CEventList : public CListHelpers
bool m_showChannel; bool m_showChannel;
int oldIndex; int oldIndex;
event_id_t oldEventID; event_id_t oldEventID;
bool bgRightBoxPaint;
bool findEvents(t_channel_id channel_id, std::string channelname); bool findEvents(t_channel_id channel_id, std::string channelname);
// Eventfinder end
CFrameBuffer *frameBuffer; CFrameBuffer *frameBuffer;
CChannelEventList evtlist; CChannelEventList evtlist;
@@ -86,36 +84,36 @@ class CEventList : public CListHelpers
unsigned int current_event; unsigned int current_event;
unsigned int liststart; unsigned int liststart;
unsigned int listmaxshow; unsigned int listmaxshow;
int fheight; // Fonthoehe Channellist-Inhalt int item_height;
int fheight1,fheight2; int largefont_height, smallfont_height;
int fwidth1,fwidth2; int header_height;
int theight; // Fonthoehe Channellist-Titel int footer_height;
int iheight; // Height info bar
std::string search_head_name; std::string search_head_name;
int full_width, width, infozone_width; int full_width, width, infozone_width;
int botboxheight; int navibar_height;
int height; int height;
int x; int x;
int y; int y;
std::string infozone_text; std::string infozone_text;
bool infozone_background;
int sort_mode; int sort_mode;
event_id_t item_event_ID; event_id_t item_event_ID;
CComponentsText *cc_infozone; CComponentsText *infozone;
CComponentsHeader *header; CComponentsHeader *header;
CProgressBar *pb; CProgressBar *pb;
CNaviBar *Bottombox; CNaviBar *navibar;
const char * unit_short_minute; const char * unit_short_minute;
void paintItem(unsigned pos, t_channel_id channel_id = 0); void paintItem(unsigned pos, t_channel_id channel_id = 0);
void paintDescription(int index); void paintDescription(int index);
void paint(t_channel_id channel_id = 0); void paint(t_channel_id channel_id = 0);
void paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev = "", std::string _channelname_next = ""); void paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev = "", std::string _channelname_next = "");
void paintBottomBox(std::string _channelname_prev, std::string _channelname_next); void paintNaviBar(std::string _channelname_prev, std::string _channelname_next);
void showProgressBar(int pos); void showProgressBar(int pos);
void hide(); void hide();
void showFunctionBar(t_channel_id channel_id); void paintFoot(t_channel_id channel_id);
void getChannelNames(t_channel_id &channel_id, std::string &current_channel_name, std::string &prev_channel_name, std::string &next_channel_name, neutrino_msg_t msg); void getChannelNames(t_channel_id &channel_id, std::string &current_channel_name, std::string &prev_channel_name, std::string &next_channel_name, neutrino_msg_t msg);
int timerPre; int timerPre;
@@ -136,7 +134,6 @@ class CEventListHandler : public CMenuTarget
{ {
public: public:
int exec( CMenuTarget* parent, const std::string &actionkey); int exec( CMenuTarget* parent, const std::string &actionkey);
}; };
class CEventFinderMenu : public CMenuTarget, CChangeObserver class CEventFinderMenu : public CMenuTarget, CChangeObserver
@@ -156,16 +153,16 @@ class CEventFinderMenu : public CMenuTarget, CChangeObserver
int selected; int selected;
int showMenu(void); int showMenu(void);
public: public:
CEventFinderMenu( int* event, CEventFinderMenu(int* event,
int* search_epg_item, int* search_epg_item,
std::string* search_keyword, std::string* search_keyword,
int* search_list, int* search_list,
t_channel_id* search_channel_id, t_channel_id* search_channel_id,
t_bouquet_id* search_bouquet_id, t_bouquet_id* search_bouquet_id,
int* search_genre, int* search_genre,
int* search_fsk int* search_fsk);
);
int exec( CMenuTarget* parent, const std::string &actionkey); int exec( CMenuTarget* parent, const std::string &actionkey);
bool changeNotify(const neutrino_locale_t OptionName, void *); bool changeNotify(const neutrino_locale_t OptionName, void *);
}; };