neutrino eventlist: rework manage painting of function bar

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


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

Origin message was:
------------------
*neutrino eventlist: rework manage painting of function bar

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


------------------
This commit was generated by Migit
This commit is contained in:
2011-10-28 22:15:54 +00:00
parent 7fa84cb7da
commit f7b3a65c03

View File

@@ -217,7 +217,7 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam
neutrino_msg_t msg; neutrino_msg_t msg;
neutrino_msg_data_t data; neutrino_msg_data_t data;
bool in_search = false; bool in_search = false;
iheight = 30; // info bar height (see below, hard coded at this time) iheight = 30; // info bar height (see below, hard coded at this time)
if(iheight < fh) if(iheight < fh)
@@ -335,16 +335,42 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam
} else } else
loop = false; loop = false;
} }
if (msg == CRCInput::RC_up || (int) msg == g_settings.key_channelList_pageup)
//manage painting of function bar during scrolling, depends of timerevent types
if (msg == CRCInput::RC_up || (int) msg == g_settings.key_channelList_pageup ||
msg == CRCInput::RC_down || (int) msg == g_settings.key_channelList_pagedown)
{ {
bool paint_buttonbar = false; //function bar
int step = 0; int step = 0;
int prev_selected = selected; int prev_selected = selected;
if ((g_settings.key_channelList_addremind != CRCInput::RC_nokey) ||
((g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) &&
(g_settings.key_channelList_addrecord != CRCInput::RC_nokey)))
{
paint_buttonbar = true;
}
if (msg == CRCInput::RC_up || (int) msg == g_settings.key_channelList_pageup)
{
step = ((int) msg == g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1
selected -= step;
if((prev_selected-step) < 0) // because of uint
selected = evtlist.size() - 1;
}
else if (msg == CRCInput::RC_down || (int) msg == g_settings.key_channelList_pagedown)
{
step = ((int) msg == g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1
selected += step;
step = ((int) msg == g_settings.key_channelList_pageup) ? listmaxshow : 1; // browse or step 1 if(selected >= evtlist.size())
selected -= step; {
if((prev_selected-step) < 0) // because of uint if (((evtlist.size() / listmaxshow) + 1) * listmaxshow == evtlist.size() + listmaxshow) // last page has full entries
selected = evtlist.size() - 1; selected = 0;
else
selected = ((step == listmaxshow) && (selected < (((evtlist.size() / listmaxshow) + 1) * listmaxshow))) ? (evtlist.size() - 1) : 0;
}
}
paintItem(prev_selected - liststart, channel_id); paintItem(prev_selected - liststart, channel_id);
unsigned int oldliststart = liststart; unsigned int oldliststart = liststart;
liststart = (selected/listmaxshow)*listmaxshow; liststart = (selected/listmaxshow)*listmaxshow;
@@ -354,45 +380,9 @@ int EventList::exec(const t_channel_id channel_id, const std::string& channelnam
else else
paintItem(selected - liststart, channel_id); paintItem(selected - liststart, channel_id);
if ((g_settings.key_channelList_addremind != CRCInput::RC_nokey) || showFunctionBar(paint_buttonbar, channel_id);
((g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) &&
(g_settings.key_channelList_addrecord != CRCInput::RC_nokey)))
{
showFunctionBar(true, channel_id);
}
} }
else if (msg == CRCInput::RC_down || (int) msg == g_settings.key_channelList_pagedown) //sort
{
unsigned int step = 0;
int prev_selected = selected;
step = ((int) msg == g_settings.key_channelList_pagedown) ? listmaxshow : 1; // browse or step 1
selected += step;
if(selected >= evtlist.size()) {
if (((evtlist.size() / listmaxshow) + 1) * listmaxshow == evtlist.size() + listmaxshow) // last page has full entries
selected = 0;
else
selected = ((step == listmaxshow) && (selected < (((evtlist.size() / listmaxshow) + 1) * listmaxshow))) ? (evtlist.size() - 1) : 0;
}
paintItem(prev_selected - liststart, channel_id);
unsigned int oldliststart = liststart;
liststart = (selected/listmaxshow)*listmaxshow;
if(oldliststart!=liststart)
paint(channel_id);
else
paintItem(selected - liststart, channel_id);
if ((g_settings.key_channelList_addremind != CRCInput::RC_nokey) ||
((g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) &&
(g_settings.key_channelList_addrecord != CRCInput::RC_nokey)))
{
showFunctionBar(true, channel_id);
}
}
else if (msg == (neutrino_msg_t)g_settings.key_channelList_sort) else if (msg == (neutrino_msg_t)g_settings.key_channelList_sort)
{ {
uint64_t selected_id = evtlist[selected].eventID; uint64_t selected_id = evtlist[selected].eventID;