mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 17:01:08 +02:00
channellist: add colored progressbars
* thx to bazi98, martii and benny
Origin commit data
------------------
Commit: df1c8ac00d
Author: vanhofen <vanhofen@gmx.de>
Date: 2014-06-23 (Mon, 23 Jun 2014)
Origin message was:
------------------
- channellist: add colored progressbars
* thx to bazi98, martii and benny
This commit is contained in:
@@ -218,6 +218,8 @@ channellist.edit Bearbeiten
|
||||
channellist.epgtext_align_left links
|
||||
channellist.epgtext_align_right rechts
|
||||
channellist.extended Sendungsfortschritt anzeigen
|
||||
channellist.extended_colored mit farbigem Fortschrittsbalken
|
||||
channellist.extended_simple mit einfachem Fortschrittsbalken
|
||||
channellist.favs Favoriten
|
||||
channellist.foot Kanalinformationen
|
||||
channellist.foot_freq Tuning-Parameter
|
||||
|
@@ -217,7 +217,9 @@ channellist.current_tp Current transponder
|
||||
channellist.edit Edit
|
||||
channellist.epgtext_align_left left
|
||||
channellist.epgtext_align_right right
|
||||
channellist.extended Show progressbars
|
||||
channellist.extended Show event progress
|
||||
channellist.extended_colored with colored progressbar
|
||||
channellist.extended_simple with simple progressbar
|
||||
channellist.favs Favoriten
|
||||
channellist.foot Channel Information
|
||||
channellist.foot_freq Sat/Freq Info
|
||||
|
@@ -2031,9 +2031,15 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
||||
l = snprintf(nameAndDescription, sizeof(nameAndDescription), "%s", chan->getName().c_str());
|
||||
|
||||
int pb_space = prg_offset - title_offset;
|
||||
CProgressBar pb(x+5+numwidth + title_offset, ypos + fheight/4, pb_space + 2, fheight/2); /* never colored */
|
||||
pb.setFrameThickness(2);
|
||||
int pb_max = pb_space - 4;
|
||||
bool pb_colored = ((g_settings.channellist_extended == 2) && g_settings.progressbar_color);
|
||||
int pb_frame = pb_colored ? 0 : 1;
|
||||
CProgressBar pb(x+5+numwidth + title_offset, ypos + fheight/4, pb_space, fheight/2,
|
||||
color, bgcolor, COL_MENUCONTENTDARK_PLUS_0, color, COL_MENUCONTENT_PLUS_1,
|
||||
pb_colored, 0, 100, 70);
|
||||
pb.setCornerType(0);
|
||||
pb.setFrameThickness(pb_frame);
|
||||
|
||||
int pb_max = pb_space - (2*pb_frame);
|
||||
if (!(p_event->description.empty())) {
|
||||
snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l,g_settings.channellist_epgtext_align_right ? " ":" - ");
|
||||
unsigned int ch_name_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(nameAndDescription);
|
||||
@@ -2074,9 +2080,9 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
||||
}
|
||||
|
||||
if (liststart + pos != selected)
|
||||
pb.setStatusColors(COL_MENUCONTENT_PLUS_3, COL_MENUCONTENT_PLUS_1);
|
||||
pb.setPassiveColor(COL_MENUCONTENT_PLUS_3);
|
||||
else
|
||||
pb.setStatusColors(COL_MENUCONTENTSELECTED_PLUS_2, COL_MENUCONTENTSELECTED_PLUS_0);
|
||||
pb.setPassiveColor(COL_MENUCONTENTSELECTED_PLUS_2);
|
||||
pb.setValues(runningPercent, pb_max);
|
||||
pb.paint();
|
||||
}
|
||||
@@ -2095,9 +2101,9 @@ void CChannelList::paintItem(int pos, const bool firstpaint)
|
||||
else {
|
||||
if(g_settings.channellist_extended) {
|
||||
if (liststart + pos != selected)
|
||||
pb.setStatusColors(COL_MENUCONTENT_PLUS_2, COL_MENUCONTENT_PLUS_1);
|
||||
pb.setPassiveColor(COL_MENUCONTENT_PLUS_1);
|
||||
else
|
||||
pb.setStatusColors(COL_MENUCONTENTSELECTED_PLUS_2, COL_MENUCONTENTSELECTED_PLUS_0);
|
||||
pb.setPassiveColor(COL_MENUCONTENTSELECTED_PLUS_2);
|
||||
pb.setValues(0, pb_max);
|
||||
pb.setZeroLine();
|
||||
pb.paint();
|
||||
|
@@ -436,6 +436,14 @@ const CMenuOptionChooser::keyval CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS[CHANNE
|
||||
{ 1 , LOCALE_CHANNELLIST_EPGTEXT_ALIGN_RIGHT }
|
||||
};
|
||||
|
||||
#define CHANNELLIST_EXTENDED_OPTIONS_COUNT 3
|
||||
const CMenuOptionChooser::keyval CHANNELLIST_EXTENDED_OPTIONS[CHANNELLIST_EXTENDED_OPTIONS_COUNT]=
|
||||
{
|
||||
{ 0, LOCALE_OPTIONS_OFF }, //none
|
||||
{ 1, LOCALE_CHANNELLIST_EXTENDED_SIMPLE }, //unicolor
|
||||
{ 2, LOCALE_CHANNELLIST_EXTENDED_COLORED } //colored
|
||||
};
|
||||
|
||||
#define OPTIONS_COLORED_EVENTS_OPTION_COUNT 3
|
||||
const CMenuOptionChooser::keyval OPTIONS_COLORED_EVENTS_OPTIONS[OPTIONS_COLORED_EVENTS_OPTION_COUNT] =
|
||||
{
|
||||
@@ -933,7 +941,7 @@ void COsdSetup::showOsdChanlistSetup(CMenuWidget *menu_chanlist)
|
||||
menu_chanlist->addItem(mc);
|
||||
|
||||
// extended channel list
|
||||
mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
|
||||
mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, CHANNELLIST_EXTENDED_OPTIONS, CHANNELLIST_EXTENDED_OPTIONS_COUNT, true);
|
||||
mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EXTENDED);
|
||||
menu_chanlist->addItem(mc);
|
||||
|
||||
@@ -1114,7 +1122,7 @@ int COsdSetup::showContextChanlistMenu()
|
||||
mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EPG_ALIGN);
|
||||
menu_chanlist->addItem(mc);
|
||||
|
||||
mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
|
||||
mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, CHANNELLIST_EXTENDED_OPTIONS, CHANNELLIST_EXTENDED_OPTIONS_COUNT, true);
|
||||
mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EXTENDED);
|
||||
menu_chanlist->addItem(mc);
|
||||
|
||||
|
@@ -660,7 +660,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
||||
g_settings.channellist_additional = configfile.getInt32("channellist_additional", 2); //default minitv
|
||||
g_settings.eventlist_additional = configfile.getInt32("eventlist_additional", 0);
|
||||
g_settings.channellist_epgtext_align_right = configfile.getBool("channellist_epgtext_align_right" , false);
|
||||
g_settings.channellist_extended = configfile.getBool("channellist_extended" , true);
|
||||
g_settings.channellist_extended = configfile.getInt32("channellist_extended", 1);
|
||||
g_settings.channellist_foot = configfile.getInt32("channellist_foot" , 1);//default next Event
|
||||
g_settings.channellist_new_zap_mode = configfile.getInt32("channellist_new_zap_mode", 1);
|
||||
g_settings.channellist_sort_mode = configfile.getInt32("channellist_sort_mode", 0);//sort mode: alpha, freq, sat
|
||||
@@ -1156,7 +1156,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
|
||||
configfile.setInt32("eventlist_additional", g_settings.eventlist_additional);
|
||||
configfile.setInt32("channellist_additional", g_settings.channellist_additional);
|
||||
configfile.setBool("channellist_epgtext_align_right", g_settings.channellist_epgtext_align_right);
|
||||
configfile.setBool("channellist_extended" , g_settings.channellist_extended);
|
||||
configfile.setInt32("channellist_extended", g_settings.channellist_extended);
|
||||
configfile.setInt32("channellist_foot" , g_settings.channellist_foot);
|
||||
configfile.setInt32("channellist_new_zap_mode", g_settings.channellist_new_zap_mode);
|
||||
configfile.setInt32("remote_control_hardware", g_settings.remote_control_hardware);
|
||||
|
@@ -245,6 +245,8 @@ typedef enum
|
||||
LOCALE_CHANNELLIST_EPGTEXT_ALIGN_LEFT,
|
||||
LOCALE_CHANNELLIST_EPGTEXT_ALIGN_RIGHT,
|
||||
LOCALE_CHANNELLIST_EXTENDED,
|
||||
LOCALE_CHANNELLIST_EXTENDED_COLORED,
|
||||
LOCALE_CHANNELLIST_EXTENDED_SIMPLE,
|
||||
LOCALE_CHANNELLIST_FAVS,
|
||||
LOCALE_CHANNELLIST_FOOT,
|
||||
LOCALE_CHANNELLIST_FOOT_FREQ,
|
||||
|
@@ -245,6 +245,8 @@ const char * locale_real_names[] =
|
||||
"channellist.epgtext_align_left",
|
||||
"channellist.epgtext_align_right",
|
||||
"channellist.extended",
|
||||
"channellist.extended_colored",
|
||||
"channellist.extended_simple",
|
||||
"channellist.favs",
|
||||
"channellist.foot",
|
||||
"channellist.foot_freq",
|
||||
|
Reference in New Issue
Block a user