- epgview: rework buttonbar logic

This commit is contained in:
svenhoefer
2016-08-03 11:12:45 +02:00
parent 25e29c30be
commit 999d61f923

View File

@@ -1319,13 +1319,24 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st
// -- 2002-05-13 rasc // -- 2002-05-13 rasc
// //
const struct button_label EpgButtons[] = #define EpgButtonsMax 4
const struct button_label EpgButtons[][EpgButtonsMax] =
{ {
{ // full view
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_TIMERBAR_RECORDEVENT }, { NEUTRINO_ICON_BUTTON_RED, LOCALE_TIMERBAR_RECORDEVENT },
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH }, { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH },
{ NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL }, { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT },
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT } { NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_CHANNELLIST_ADDITIONAL }
},
{ // w/o followscreenings
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_TIMERBAR_RECORDEVENT },
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH },
{ NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_CHANNELLIST_ADDITIONAL }
},
{ // movieplayer mode
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_EPG_SAVING },
{ NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_CHANNELLIST_ADDITIONAL }
}
}; };
void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info)
@@ -1356,20 +1367,22 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info)
adzap_button += " " + to_string(g_settings.adzap_zapBackPeriod / 60) + " "; adzap_button += " " + to_string(g_settings.adzap_zapBackPeriod / 60) + " ";
adzap_button += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); adzap_button += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE);
} }
if (!mp_info && g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) bool tmdb = (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 4:3, EpgButtons, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 1); bool fscr = (has_follow_screenings && !call_fromfollowlist);
else if (mp_info){ if (mp_info)
const struct button_label Button[] = ::paintButtons(x, y, 0, tmdb ? 2 : 1, EpgButtons[2], aw, h);
else
{ {
{ NEUTRINO_ICON_BUTTON_RED , LOCALE_EPG_SAVING }, int c = EpgButtonsMax;
{ NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL } if (!tmdb)
}; c--; // reduce tmdb button
if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"){ if (!fscr)
::paintButtons(x , y, 0, 2, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); c--; // reduce blue button
if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)
::paintButtons(x, y, 0, c, EpgButtons[fscr ? 0 : 1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 1);
else
::paintButtons(x, y, 0, c, &EpgButtons[fscr ? 0 : 1][1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 0);
} }
}else
::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, &EpgButtons[1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 0);
#if 0 #if 0
// Button: Timer Record & Channelswitch // Button: Timer Record & Channelswitch
if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)