- eventlist: move info button from header to buttonbar

* remove unused button_label structs

Conflicts:
	src/gui/eventlist.cpp
This commit is contained in:
svenhoefer
2013-04-30 12:59:13 +02:00
committed by [CST] Focus
parent 16b8f6d9a0
commit fff07ea64e

View File

@@ -790,15 +790,13 @@ void CNeutrinoEventList::paintItem(unsigned int pos, t_channel_id channel_idI)
void CNeutrinoEventList::paintHead(std::string _channelname, std::string _channelname_prev, std::string _channelname_next) void CNeutrinoEventList::paintHead(std::string _channelname, std::string _channelname_prev, std::string _channelname_next)
{ {
const short font_h = 8; const short font_h = 8;
int iw = 0, ih = 0;
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_INFO, &iw, &ih);
frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); frameBuffer->paintBoxRel(x,y, width,theight+0, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP);
int name_width =((width-8-iw)/3); int name_width = width/3 ;
short prev_len = g_Font[font_h]->getRenderWidth(_channelname_prev.c_str(),true); short prev_len = g_Font[font_h]->getRenderWidth(_channelname_prev.c_str(),true);
short next_len = g_Font[font_h]->getRenderWidth(_channelname_next.c_str(),true); short next_len = g_Font[font_h]->getRenderWidth(_channelname_next.c_str(),true);
short middle_len = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getRenderWidth(_channelname.c_str(),true); short middle_len = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getRenderWidth(_channelname.c_str(),true);
short middle_offset = (width- next_len- prev_len- middle_len-iw-8)/2; short middle_offset = (width- next_len- prev_len- middle_len)/2;
if(middle_offset < 0){ if(middle_offset < 0){
int fw_h = g_Font[font_h]->getWidth(); int fw_h = g_Font[font_h]->getWidth();
int newsize = abs(middle_offset / fw_h) + 1; int newsize = abs(middle_offset / fw_h) + 1;
@@ -838,13 +836,6 @@ void CNeutrinoEventList::paint(t_channel_id channel_id)
{ {
liststart = (selected/listmaxshow)*listmaxshow; liststart = (selected/listmaxshow)*listmaxshow;
int iw = 0, ih = 0;
if (evtlist[0].eventID != 0) {
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_INFO, &iw, &ih);
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_INFO, x+ width - 4 - iw, y, theight);
}
for(unsigned int count=0;count<listmaxshow;count++) for(unsigned int count=0;count<listmaxshow;count++)
{ {
paintItem(count, channel_id); paintItem(count, channel_id);
@@ -862,31 +853,6 @@ void CNeutrinoEventList::paint(t_channel_id channel_id)
} }
#define NUM_EVENTLIST_FIRST_BUTTON 1
struct button_label EventListFirstButton[NUM_EVENTLIST_FIRST_BUTTON] =
{
{ "", LOCALE_EVENTLISTBAR_RECORDEVENT } // record button
};
#define NUM_EVENTLIST_SECOND_BUTTON 1
struct button_label EventListSecondButton[NUM_EVENTLIST_SECOND_BUTTON] =
{
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_EVENTFINDER_SEARCH } // search button
};
#define NUM_EVENTLIST_THIRD_BUTTON 1
struct button_label EventListThirdButton[NUM_EVENTLIST_THIRD_BUTTON] =
{
{ "", LOCALE_EVENTLISTBAR_CHANNELSWITCH } // timer event channel switch button
};
#define NUM_EVENTLIST_FOURTH_BUTTON 1
struct button_label EventListFourthButton[NUM_EVENTLIST_FOURTH_BUTTON] =
{
{ "", LOCALE_EVENTLISTBAR_EVENTSORT } // sort event button
};
void CNeutrinoEventList::showFunctionBar (bool show, t_channel_id channel_id) void CNeutrinoEventList::showFunctionBar (bool show, t_channel_id channel_id)
{ {
int border_space = 4; int border_space = 4;
@@ -898,7 +864,7 @@ void CNeutrinoEventList::showFunctionBar (bool show, t_channel_id channel_id)
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;
struct button_label buttons[4]; struct button_label buttons[5];
int btn_cnt = 0; int btn_cnt = 0;
bh = std::max(FunctionBarHeight, bh); bh = std::max(FunctionBarHeight, bh);
@@ -958,6 +924,14 @@ void CNeutrinoEventList::showFunctionBar (bool show, t_channel_id channel_id)
btn_cnt++; btn_cnt++;
} }
} }
// info button
if (evtlist[0].eventID != 0) {
buttons[btn_cnt].button = NEUTRINO_ICON_BUTTON_INFO_SMALL;
buttons[btn_cnt].locale = LOCALE_EPGMENU_EVENTINFO;
btn_cnt++;
}
FunctionBarHeight = std::max(::paintButtons(bx, by, bw, btn_cnt, buttons, bw), FunctionBarHeight); FunctionBarHeight = std::max(::paintButtons(bx, by, bw, btn_cnt, buttons, bw), FunctionBarHeight);
} }