neutrino channellist: moved paint of buttonbar into it's own member

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1721 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: 7809fad0bb
Author: Thilo Graf <dbt@novatux.de>
Date: 2011-10-01 (Sat, 01 Oct 2011)

Origin message was:
------------------
*neutrino channellist: moved paint of buttonbar into it's own member

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1721 e54a6e83-5905-42d5-8d5c-058d10e6a962


------------------
This commit was generated by Migit
This commit is contained in:
2011-10-01 21:11:34 +00:00
parent 6d6f439193
commit eb6d31eb13
3 changed files with 40 additions and 46 deletions

View File

@@ -87,7 +87,6 @@ install_DATA = \
mainmenue.png \ mainmenue.png \
mounted.png \ mounted.png \
movie.png \ movie.png \
movieplayer.raw \
mp_b-skip.png \ mp_b-skip.png \
mp_f-skip.png \ mp_f-skip.png \
mp_pause.png \ mp_pause.png \

View File

@@ -1761,22 +1761,44 @@ void CChannelList::showChannelLogo()
} }
} }
#define NUM_LIST_REC_BUTTON 1 #define NUM_LIST_BUTTONS 4
struct button_label SRecButton[NUM_LIST_REC_BUTTON] = struct button_label SChannelListButtons[NUM_LIST_BUTTONS] =
{
{ NEUTRINO_ICON_BUTTON_RECORD_ACTIVE_16, LOCALE_MAINMENU_RECORDING}
};
#define NUM_LIST_REC_BUTTON_STOP 1
struct button_label SRecButtonStop[NUM_LIST_REC_BUTTON_STOP] =
{
{ NEUTRINO_ICON_BUTTON_STOP_16, LOCALE_MAINMENU_RECORDING_STOP}
};
#define NUM_LIST_REC_BUTTON_DISABLED 1
struct button_label SRecButtonDisabled[NUM_LIST_REC_BUTTON_DISABLED] =
{ {
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_INFOVIEWER_EVENTLIST},
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_INFOVIEWER_NEXT},
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_BOUQUETLIST_HEAD},
{ NEUTRINO_ICON_BUTTON_RECORD_INACTIVE_16, NONEXISTANT_LOCALE} { NEUTRINO_ICON_BUTTON_RECORD_INACTIVE_16, NONEXISTANT_LOCALE}
}; };
void CChannelList::paintButtonBar(bool do_rec, bool is_current)
{
printf("[neutrino channellist] %s...%d\n", __FUNCTION__, __LINE__);
//default color buttons
if (displayNext)
SChannelListButtons[1].locale = LOCALE_INFOVIEWER_NOW;
else
SChannelListButtons[1].locale = LOCALE_INFOVIEWER_NEXT;
//manage record button
if (g_settings.recording_type != RECORDING_OFF && !displayNext){
if (is_current && !do_rec){
SChannelListButtons[3].locale = LOCALE_MAINMENU_RECORDING;
SChannelListButtons[3].button = NEUTRINO_ICON_BUTTON_RECORD_ACTIVE_16;
}else if (do_rec){
SChannelListButtons[3].locale = LOCALE_MAINMENU_RECORDING_STOP;
SChannelListButtons[3].button = NEUTRINO_ICON_BUTTON_STOP_16;
}else{
SChannelListButtons[3].locale = NONEXISTANT_LOCALE;
SChannelListButtons[3].button = NEUTRINO_ICON_BUTTON_RECORD_INACTIVE_16;
}
}
//paint buttons
int y_foot = y + (height - footerHeight);
::paintButtons(x, y_foot, width, NUM_LIST_BUTTONS, SChannelListButtons, footerHeight/*, (width - 20) / NUM_LIST_BUTTONS*/); //buttonwidth will set automaticly
}
void CChannelList::paintItem(int pos) void CChannelList::paintItem(int pos)
{ {
int ypos = y+ theight+0 + pos*fheight; int ypos = y+ theight+0 + pos*fheight;
@@ -1805,6 +1827,7 @@ void CChannelList::paintItem(int pos)
bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0; bgcolor = iscurrent ? COL_MENUCONTENT_PLUS_0 : COL_MENUCONTENTINACTIVE_PLUS_0;
frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, 0); frameBuffer->paintBoxRel(x,ypos, width- 15, fheight, bgcolor, 0);
} }
if(curr < chanlist.size()) { if(curr < chanlist.size()) {
char nameAndDescription[255]; char nameAndDescription[255];
char tmp[10]; char tmp[10];
@@ -1841,23 +1864,13 @@ void CChannelList::paintItem(int pos)
if (frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, icon_x - s_icon_w, ypos, fheight))//ypos + (fheight - 16)/2); if (frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, icon_x - s_icon_w, ypos, fheight))//ypos + (fheight - 16)/2);
r_icon_x = r_icon_x - s_icon_w; r_icon_x = r_icon_x - s_icon_w;
//paint recording icon //paint recording icon
bool do_rec = CRecordManager::getInstance()->RecordingStatus(chanlist[curr]->channel_id); bool do_rec = CRecordManager::getInstance()->RecordingStatus(chanlist[curr]->channel_id);
if (do_rec) if (do_rec)
frameBuffer->paintIcon(NEUTRINO_ICON_REC, r_icon_x - r_icon_w, ypos, fheight);//ypos + (fheight - 16)/2); frameBuffer->paintIcon(NEUTRINO_ICON_REC, r_icon_x - r_icon_w, ypos, fheight);//ypos + (fheight - 16)/2);
//paint record and stop buttons //paint buttons
if (g_settings.recording_type != RECORDING_OFF) paintButtonBar(do_rec, iscurrent);
{
int y_foot = y + (height - footerHeight);
int bb_w = width/2;
if (iscurrent && !do_rec)
::paintButtons(x+bb_w, y_foot, bb_w, NUM_LIST_REC_BUTTON, SRecButton, footerHeight);
else if (do_rec)
::paintButtons(x+bb_w, y_foot, bb_w, NUM_LIST_REC_BUTTON_STOP, SRecButtonStop, footerHeight);
else
::paintButtons(x+bb_w, y_foot, bb_w, NUM_LIST_REC_BUTTON_DISABLED, SRecButtonDisabled, footerHeight);
}
int icon_space = r_icon_w+s_icon_w; int icon_space = r_icon_w+s_icon_w;
@@ -1961,14 +1974,6 @@ void CChannelList::paintItem(int pos)
} }
} }
#define NUM_LIST_BUTTONS 3
struct button_label CChannelListButtons[NUM_LIST_BUTTONS] =
{
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_INFOVIEWER_EVENTLIST},
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_INFOVIEWER_NEXT},
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_BOUQUETLIST_HEAD}
};
void CChannelList::paintHead() void CChannelList::paintHead()
{ {
int timestr_len = 0; int timestr_len = 0;
@@ -2005,17 +2010,6 @@ void CChannelList::paintHead()
timestr_len += iw1 + iw2 + iw3 + 16; timestr_len += iw1 + iw2 + iw3 + 16;
logo_off = timestr_len + 4; logo_off = timestr_len + 4;
g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8 g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->RenderString(x+10,y+theight+0, width - timestr_len, name, COL_MENUHEAD, 0, true); // UTF-8
//foot/buttonbar
if (displayNext)
CChannelListButtons[1].locale = LOCALE_INFOVIEWER_NOW;
else
CChannelListButtons[1].locale = LOCALE_INFOVIEWER_NEXT;
//paint default buttons
int y_foot = y + (height - footerHeight);
::paintButtons(x, y_foot, width, NUM_LIST_BUTTONS, CChannelListButtons, footerHeight/*, (width - 20) / NUM_LIST_BUTTONS*/); //buttonwidth will set automaticly
} }
void CChannelList::paint() void CChannelList::paint()

View File

@@ -88,6 +88,7 @@ private:
void paintItem(int pos); void paintItem(int pos);
void paint(); void paint();
void paintHead(); void paintHead();
void paintButtonBar(bool do_rec, bool is_current);
void hide(); void hide();
void showChannelLogo(); void showChannelLogo();