Colors: init global color gradient implementation

Origin commit data
------------------
Branch: ni/coolstream
Commit: 523b273af8
Author: Thilo Graf <dbt@novatux.de>
Date: 2015-11-19 (Thu, 19 Nov 2015)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
2015-11-19 15:59:48 +01:00
parent 3a2e7b85f8
commit 9f101bddbc
18 changed files with 725 additions and 361 deletions

View File

@@ -82,10 +82,7 @@ COsdSetup::COsdSetup(int wizard_mode)
mfTtxFontFile = NULL;
mfWindowSize = NULL;
win_demo = NULL;
ca_dotmatrix = NULL;
ca_frame = NULL;
osd_menu_colors = NULL;
is_wizard = wizard_mode;
width = 40;
@@ -98,6 +95,8 @@ COsdSetup::~COsdSetup()
delete colorSetupNotifier;
delete fontsizenotifier;
delete win_demo;
if (osd_menu_colors)
delete osd_menu_colors;
}
//font settings
@@ -253,7 +252,8 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey)
if (xre != g_settings.screen_xres || yre != g_settings.screen_yres) {
printf("[neutrino] new font scale settings x: %d%% y: %d%%\n", g_settings.screen_xres, g_settings.screen_yres);
CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT | CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT_INST);
CNeutrinoApp::getInstance()->SetupFonts(CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT | CNeutrinoFonts::FONTSETUP_NEUTRINO_FONT_INST | CNeutrinoFonts::FONTSETUP_DYN_FONT);
CNeutrinoApp::getInstance()->channelList->ResetModules(); //force re init of all modules
}
return res;
}
@@ -464,6 +464,25 @@ const CMenuOptionChooser::keyval OPTIONS_COLORED_EVENTS_OPTIONS[OPTIONS_COLORED_
{ 2, LOCALE_MISCSETTINGS_COLORED_EVENTS_2 }, //next
};
#define OPTIONS_COL_GRADIENT_OPTIONS_COUNT CC_COLGRAD_TYPES //TODO: add modes for intensity
const CMenuOptionChooser::keyval OPTIONS_COL_GRADIENT_OPTIONS[OPTIONS_COL_GRADIENT_OPTIONS_COUNT] =
{
{ CC_COLGRAD_OFF , LOCALE_OPTIONS_OFF },
{ CC_COLGRAD_COL_A_2_COL_B , LOCALE_COLOR_GRADIENT_A2B }, //color A to color B
{ CC_COLGRAD_COL_B_2_COL_A , LOCALE_COLOR_GRADIENT_B2A }, //color B to color A
{ CC_COLGRAD_LIGHT_2_DARK , LOCALE_COLOR_GRADIENT_L2D }, //light to dark
{ CC_COLGRAD_DARK_2_LIGHT , LOCALE_COLOR_GRADIENT_D2L }, //dark to light
{ CC_COLGRAD_COL_LIGHT_DARK_LIGHT , LOCALE_COLOR_GRADIENT_LDL }, //light dark light
{ CC_COLGRAD_COL_DARK_LIGHT_DARK , LOCALE_COLOR_GRADIENT_DLD }, //dark light dark
};
#define OPTIONS_COL_GRADIENT_DIRECTION_OPTIONS_COUNT 2
const CMenuOptionChooser::keyval OPTIONS_COL_GRADIENT_DIRECTION_OPTIONS[OPTIONS_COL_GRADIENT_DIRECTION_OPTIONS_COUNT] =
{
{ CFrameBuffer::gradientHorizontal , LOCALE_COLOR_GRADIENT_MODE_DIRECTION_HOR }, //horizontal
{ CFrameBuffer::gradientVertical , LOCALE_COLOR_GRADIENT_MODE_DIRECTION_VER }, //vertical
};
/* these are more descriptive... */
#define _LOCALE_PROGRESSBAR_COLOR_MATRIX LOCALE_MISCSETTINGS_PROGRESSBAR_DESIGN_0
#define _LOCALE_PROGRESSBAR_COLOR_VERTICAL LOCALE_MISCSETTINGS_PROGRESSBAR_DESIGN_1
@@ -492,14 +511,15 @@ int COsdSetup::showOsdSetup()
osd_menu->setWizardMode(is_wizard);
//menu colors
CMenuWidget osd_menu_colors(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_COLORS, width, MN_WIDGET_ID_OSDSETUP_MENUCOLORS);
if (osd_menu_colors == NULL)
osd_menu_colors = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_COLORS, width, MN_WIDGET_ID_OSDSETUP_MENUCOLORS);
//intro with subhead and back button
osd_menu->addIntroItems(LOCALE_MAINSETTINGS_OSD);
//item menu colors
showOsdMenueColorSetup(&osd_menu_colors);
CMenuForwarder * mf = new CMenuForwarder(LOCALE_COLORMENU_MENUCOLORS, true, NULL, &osd_menu_colors, NULL, CRCInput::RC_red);
showOsdMenueColorSetup(osd_menu_colors);
CMenuForwarder * mf = new CMenuForwarder(LOCALE_COLORMENU_MENUCOLORS, true, NULL, osd_menu_colors, NULL, CRCInput::RC_red);
mf->setHint("", LOCALE_MENU_HINT_COLORS);
osd_menu->addItem(mf);
@@ -592,8 +612,7 @@ int COsdSetup::showOsdSetup()
osd_menu->addItem(mc);
// round corners
int rounded_corners = g_settings.rounded_corners;
mc = new CMenuOptionChooser(LOCALE_EXTRA_ROUNDED_CORNERS, &rounded_corners, MENU_CORNERSETTINGS_TYPE_OPTIONS, MENU_CORNERSETTINGS_TYPE_OPTION_COUNT, true, this);
mc = new CMenuOptionChooser(LOCALE_EXTRA_ROUNDED_CORNERS, &g_settings.rounded_corners, MENU_CORNERSETTINGS_TYPE_OPTIONS, MENU_CORNERSETTINGS_TYPE_OPTION_COUNT, true, this);
mc->setHint("", LOCALE_MENU_HINT_ROUNDED_CORNERS);
osd_menu->addItem(mc);
@@ -630,7 +649,7 @@ int COsdSetup::showOsdSetup()
CVolumeHelper::getInstance()->refresh();
if (oldInfoClockSize != g_settings.infoClockFontSize) {
CInfoClock::getInstance()->setClockFontSize(g_settings.infoClockFontSize);
CInfoClock::getInstance()->setHeight(g_settings.infoClockFontSize);
CVolumeHelper::getInstance()->refresh();
if (CNeutrinoApp::getInstance()->isMuted()) {
CAudioMute::getInstance()->enableMuteIcon(false);
@@ -659,32 +678,34 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors)
sigc::slot0<void> slot_repaint = sigc::mem_fun(menu_colors, &CMenuWidget::paint); //we want to repaint after changed Option
CColorChooser* chHeadcolor = new CColorChooser(LOCALE_COLORMENU_BACKGROUND, &t.menu_Head_red, &t.menu_Head_green, &t.menu_Head_blue,
&t.menu_Head_alpha, colorSetupNotifier);
&t.menu_Head_alpha, &g_settings.theme.menu_Head_gradient, colorSetupNotifier);
chHeadcolor->setGradient(CColorChooser::gradient_head_body);
CColorChooser* chHeadTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Head_Text_red, &t.menu_Head_Text_green, &t.menu_Head_Text_blue,
NULL, colorSetupNotifier);
NULL, NULL, colorSetupNotifier);
chHeadTextcolor->setGradient(CColorChooser::gradient_head_text);
CColorChooser* chContentcolor = new CColorChooser(LOCALE_COLORMENU_BACKGROUND, &t.menu_Content_red, &t.menu_Content_green, &t.menu_Content_blue,
&t.menu_Content_alpha, colorSetupNotifier);
&t.menu_Content_alpha, NULL, colorSetupNotifier);
CColorChooser* chContentTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Content_Text_red, &t.menu_Content_Text_green, &t.menu_Content_Text_blue,
NULL, colorSetupNotifier);
NULL, NULL, colorSetupNotifier);
CColorChooser* chContentSelectedcolor = new CColorChooser(LOCALE_COLORMENU_BACKGROUND, &t.menu_Content_Selected_red, &t.menu_Content_Selected_green, &t.menu_Content_Selected_blue,
&t.menu_Content_Selected_alpha, colorSetupNotifier);
&t.menu_Content_Selected_alpha, NULL, colorSetupNotifier);
CColorChooser* chContentSelectedTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Content_Selected_Text_red, &t.menu_Content_Selected_Text_green, &t.menu_Content_Selected_Text_blue,
NULL, colorSetupNotifier);
NULL, NULL, colorSetupNotifier);
CColorChooser* chContentInactivecolor = new CColorChooser(LOCALE_COLORMENU_BACKGROUND, &t.menu_Content_inactive_red, &t.menu_Content_inactive_green, &t.menu_Content_inactive_blue,
&t.menu_Content_inactive_alpha, colorSetupNotifier);
&t.menu_Content_inactive_alpha, NULL, colorSetupNotifier);
CColorChooser* chContentInactiveTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Content_inactive_Text_red, &t.menu_Content_inactive_Text_green, &t.menu_Content_inactive_Text_blue,
NULL, colorSetupNotifier);
NULL, NULL, colorSetupNotifier);
menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORMENUSETUP_MENUHEAD));
CMenuOptionChooser *oj;
#if 0
oj = new CMenuOptionChooser(LOCALE_COLOR_GRADIENT_C2C, &g_settings.theme.gradient_c2c, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true );
oj->OnAfterChangeOption.connect(slot_repaint);
oj->setHint("", LOCALE_MENU_HINT_COLOR_GRADIENT_C2C);
menu_colors->addItem(oj);
menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE));
#endif
mf = new CMenuDForwarder(LOCALE_COLORMENU_BACKGROUND, true, NULL, chHeadcolor );
mf->setHint("", LOCALE_MENU_HINT_HEAD_BACK);
@@ -694,12 +715,18 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors)
mf->setHint("", LOCALE_MENU_HINT_HEAD_TEXTCOLOR);
menu_colors->addItem(mf);
// head color gradient
oj = new CMenuOptionChooser(LOCALE_COLOR_GRADIENT, &g_settings.theme.menu_Head_gradient, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true );
// head color gradient //TODO: disable sub options if head gradient is disabled
oj = new CMenuOptionChooser(LOCALE_COLOR_GRADIENT, &g_settings.theme.menu_Head_gradient, OPTIONS_COL_GRADIENT_OPTIONS, OPTIONS_COL_GRADIENT_OPTIONS_COUNT, true );
oj->OnAfterChangeOption.connect(slot_repaint);
oj->setHint("", LOCALE_MENU_HINT_COLOR_GRADIENT);
menu_colors->addItem(oj);
// head color gradient direction
oj = new CMenuOptionChooser(LOCALE_COLOR_GRADIENT_MODE_DIRECTION, &g_settings.theme.menu_Head_gradient_direction, OPTIONS_COL_GRADIENT_DIRECTION_OPTIONS, OPTIONS_COL_GRADIENT_DIRECTION_OPTIONS_COUNT, true );
oj->OnAfterChangeOption.connect(slot_repaint);
oj->setHint("", LOCALE_MENU_HINT_COLOR_GRADIENT_DIRECTION);
menu_colors->addItem(oj);
menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORMENUSETUP_MENUCONTENT));
mf = new CMenuDForwarder(LOCALE_COLORMENU_BACKGROUND, true, NULL, chContentcolor );
mf->setHint("", LOCALE_MENU_HINT_CONTENT_BACK);
@@ -729,18 +756,31 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors)
// hintbox color gradient
menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORTHEMEMENU_MENU_HINTS));
oj = new CMenuOptionChooser(LOCALE_COLOR_GRADIENT, &t.menu_Hint_gradient, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
oj = new CMenuOptionChooser(LOCALE_COLOR_GRADIENT, &t.menu_Hint_gradient, OPTIONS_COL_GRADIENT_OPTIONS, OPTIONS_COL_GRADIENT_OPTIONS_COUNT, true);
oj->OnAfterChangeOption.connect(slot_repaint);
oj->setHint("", LOCALE_MENU_HINT_COLOR_GRADIENT);
menu_colors->addItem(oj);
// hintbox color gradient direction
oj = new CMenuOptionChooser(LOCALE_COLOR_GRADIENT_MODE_DIRECTION, &t.menu_Hint_gradient_direction, OPTIONS_COL_GRADIENT_DIRECTION_OPTIONS, OPTIONS_COL_GRADIENT_DIRECTION_OPTIONS_COUNT, true );
oj->OnAfterChangeOption.connect(slot_repaint);
oj->setHint("", LOCALE_MENU_HINT_COLOR_GRADIENT_DIRECTION);
menu_colors->addItem(oj);
// menue separator line gradient enable
menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE));
oj = new CMenuOptionChooser(LOCALE_COLOR_GRADIENT_SEPARATOR_ENABLE, &t.menu_Separator_gradient_enable, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true );
oj->OnAfterChangeOption.connect(slot_repaint);
oj->setHint("", LOCALE_MENU_HINT_COLOR_GRADIENT_SEPARATOR_ENABLE);
menu_colors->addItem(oj);
// infoviewer color
CColorChooser* chInfobarcolor = new CColorChooser(LOCALE_COLORMENU_BACKGROUND, &t.infobar_red,
&t.infobar_green, &t.infobar_blue, &t.infobar_alpha, colorSetupNotifier);
&t.infobar_green, &t.infobar_blue, &t.infobar_alpha, NULL, colorSetupNotifier);
CColorChooser* chInfobarTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.infobar_Text_red,
&t.infobar_Text_green, &t.infobar_Text_blue, NULL, colorSetupNotifier);
&t.infobar_Text_green, &t.infobar_Text_blue, NULL, NULL, colorSetupNotifier);
CColorChooser* chInfobarCASystem = new CColorChooser(LOCALE_COLORMENU_BACKGROUND, &t.infobar_casystem_red,
&t.infobar_casystem_green, &t.infobar_casystem_blue, &t.infobar_casystem_alpha, colorSetupNotifier);
&t.infobar_casystem_green, &t.infobar_casystem_blue, &t.infobar_casystem_alpha, NULL, colorSetupNotifier);
menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORSTATUSBAR_TEXT));
mf = new CMenuDForwarder(LOCALE_COLORMENU_BACKGROUND, true, NULL, chInfobarcolor );
@@ -751,23 +791,48 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors)
mf->setHint("", LOCALE_MENU_HINT_INFOBAR_TEXTCOLOR);
menu_colors->addItem(mf);
mf = new CMenuDForwarder(LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY, g_settings.casystem_display < 2, NULL, chInfobarCASystem );
mf->setHint("", LOCALE_MENU_HINT_INFOBAR_CASYS_COLOR);
menu_colors->addItem(mf);
// infoviewer gradient top
oj = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_GRADIENT_TOP, &t.infobar_gradient_top, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE));
oj = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_GRADIENT_TOP, &t.infobar_gradient_top, OPTIONS_COL_GRADIENT_OPTIONS, OPTIONS_COL_GRADIENT_OPTIONS_COUNT, true);
oj->setHint("", LOCALE_MENU_HINT_COLOR_GRADIENT);
menu_colors->addItem(oj);
// infoviewer gradient top direction
oj = new CMenuOptionChooser(LOCALE_COLOR_GRADIENT_MODE_DIRECTION, &t.infobar_gradient_top_direction, OPTIONS_COL_GRADIENT_DIRECTION_OPTIONS, OPTIONS_COL_GRADIENT_DIRECTION_OPTIONS_COUNT, true );
oj->setHint("", LOCALE_MENU_HINT_COLOR_GRADIENT_DIRECTION);
menu_colors->addItem(oj);
// infoviewer gradient body
menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE));
oj = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_GRADIENT_BODY, &t.infobar_gradient_body, OPTIONS_COL_GRADIENT_OPTIONS, OPTIONS_COL_GRADIENT_OPTIONS_COUNT, true);
oj->setHint("", LOCALE_MENU_HINT_COLOR_GRADIENT);
menu_colors->addItem(oj);
// infoviewer gradient body direction
oj = new CMenuOptionChooser(LOCALE_COLOR_GRADIENT_MODE_DIRECTION, &t.infobar_gradient_body_direction, OPTIONS_COL_GRADIENT_DIRECTION_OPTIONS, OPTIONS_COL_GRADIENT_DIRECTION_OPTIONS_COUNT, true );
oj->setHint("", LOCALE_MENU_HINT_COLOR_GRADIENT_DIRECTION);
menu_colors->addItem(oj);
// infoviewer gradient bottom
oj = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_GRADIENT_BOTTOM, &t.infobar_gradient_bottom, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE));
oj = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_GRADIENT_BOTTOM, &t.infobar_gradient_bottom, OPTIONS_COL_GRADIENT_OPTIONS, OPTIONS_COL_GRADIENT_OPTIONS_COUNT, true);
oj->setHint("", LOCALE_MENU_HINT_COLOR_GRADIENT);
menu_colors->addItem(oj);
// infoviewer gradient bottom direction
oj = new CMenuOptionChooser(LOCALE_COLOR_GRADIENT_MODE_DIRECTION, &t.infobar_gradient_bottom_direction, OPTIONS_COL_GRADIENT_DIRECTION_OPTIONS, OPTIONS_COL_GRADIENT_DIRECTION_OPTIONS_COUNT, true );
oj->setHint("", LOCALE_MENU_HINT_COLOR_GRADIENT_DIRECTION);
menu_colors->addItem(oj);
// ca bar
menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE));
mf = new CMenuDForwarder(LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY, g_settings.infobar_casystem_display < 2, NULL, chInfobarCASystem );
mf->setHint("", LOCALE_MENU_HINT_INFOBAR_CASYS_COLOR);
menu_colors->addItem(mf);
// colored events
CColorChooser* chColored_Events = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.colored_events_red,
&t.colored_events_green, &t.colored_events_blue, NULL, colorSetupNotifier);
&t.colored_events_green, &t.colored_events_blue, NULL, NULL, colorSetupNotifier);
menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_MISCSETTINGS_COLORED_EVENTS));
@@ -891,6 +956,7 @@ void COsdSetup::showOsdFontSizeSetup(CMenuWidget *menu_fonts)
fontSettings->addItem(mf);
w_index++;
}
g_InfoViewer->ResetModules();
}
//osd timeouts
@@ -967,6 +1033,7 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar)
menu_infobar->addIntroItems(LOCALE_MISCSETTINGS_INFOBAR);
infobarHddNotifier = new COnOffNotifier();
sigc::slot0<void> slot_ibar = sigc::mem_fun(g_InfoViewer, &CInfoViewer::ResetModules);
CMenuOptionChooser * mc;
CMenuForwarder * mf;
@@ -985,6 +1052,7 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar)
// display options
mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_DISP, &g_settings.infobar_show_channellogo, LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS, LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS_COUNT, true);
mc->OnAfterChangeOption.connect(slot_ibar);
mc->setHint("", LOCALE_MENU_HINT_INFOBAR_LOGO);
menu_infobar->addItem(mc);
@@ -995,25 +1063,32 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar)
// satellite/cable provider
mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SAT_DISPLAY, &g_settings.infobar_sat_display, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
mc->OnAfterChangeOption.connect(slot_ibar);
mc->setHint("", LOCALE_MENU_HINT_INFOBAR_SAT);
menu_infobar->addItem(mc);
menu_infobar->addItem(GenericMenuSeparator);
// CA system
mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY, &g_settings.casystem_display, INFOBAR_CASYSTEM_MODE_OPTIONS, INFOBAR_CASYSTEM_MODE_OPTION_COUNT, true, this);
casystemActivate.Clear(); //ensure empty activator object -> cleanup before add new items, prevents possible segfault!
mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY, &g_settings.infobar_casystem_display, INFOBAR_CASYSTEM_MODE_OPTIONS, INFOBAR_CASYSTEM_MODE_OPTION_COUNT, true, this);
mc->OnAfterChangeOption.connect(slot_ibar);
mc->setHint("", LOCALE_MENU_HINT_INFOBAR_CASYS);
menu_infobar->addItem(mc);
#if 1
// CA system dotmatrix
ca_dotmatrix = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DOTMATRIX, &g_settings.casystem_dotmatrix, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.casystem_display < 2);
ca_dotmatrix->setHint("", LOCALE_MENU_HINT_INFOBAR_CASYS_DOTMATRIX);
menu_infobar->addItem(ca_dotmatrix);
mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DOTMATRIX, &g_settings.infobar_casystem_dotmatrix, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.infobar_casystem_display < 2);
mc->setHint("", LOCALE_MENU_HINT_INFOBAR_CASYS_DOTMATRIX);
menu_infobar->addItem(mc);
casystemActivate.Add(mc);
#endif
// CA system frame
ca_frame = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_FRAME, &g_settings.casystem_frame, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.casystem_display < 2);
ca_frame->setHint("", LOCALE_MENU_HINT_INFOBAR_CASYS_FRAME);
menu_infobar->addItem(ca_frame);
mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_FRAME, &g_settings.infobar_casystem_frame, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.infobar_casystem_display < 2);
mc->OnAfterChangeOption.connect(slot_ibar);
mc->setHint("", LOCALE_MENU_HINT_INFOBAR_CASYS_FRAME);
menu_infobar->addItem(mc);
casystemActivate.Add(mc);
menu_infobar->addItem(GenericMenuSeparator);
@@ -1039,6 +1114,7 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar)
p_show_tuner_icon = &g_settings.infobar_show_tuner;
}
mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SHOW_TUNER, p_show_tuner_icon, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, mc_active);
mc->OnAfterChangeOption.connect(slot_ibar);
mc->setHint("", LOCALE_MENU_HINT_INFOBAR_TUNER);
menu_infobar->addItem(mc);
@@ -1055,6 +1131,7 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar)
menu_infobar->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_MISCSETTINGS_PROGRESSBAR));
// progressbar position
mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_PROGRESSBAR_INFOBAR_POSITION, &g_settings.infobar_progressbar, PROGRESSBAR_INFOBAR_POSITION_OPTIONS, PROGRESSBAR_INFOBAR_POSITION_COUNT, true);
mc->OnAfterChangeOption.connect(slot_ibar);
mc->setHint("", LOCALE_MENU_HINT_PROGRESSBAR_INFOBAR_POSITION);
menu_infobar->addItem(mc);
}
@@ -1177,11 +1254,14 @@ void COsdSetup::showOsdInfoclockSetup(CMenuWidget *menu_infoclock)
// digit color
CColorChooser* cc = new CColorChooser(LOCALE_COLORMENU_CLOCK_TEXTCOLOR, &g_settings.theme.clock_Digit_red, &g_settings.theme.clock_Digit_green, &g_settings.theme.clock_Digit_blue,
NULL, colorSetupNotifier);
NULL, NULL, colorSetupNotifier);
CMenuDForwarder* mf = new CMenuDForwarder(LOCALE_COLORMENU_CLOCK_TEXTCOLOR, !g_settings.infoClockBackground, NULL, cc);
mf->setHint("", LOCALE_MENU_HINT_CLOCK_TEXTCOLOR);
menu_infoclock->addItem(mf);
colorInfoclockNotifier->addItem(mf);
//ensure clock reinit after setup
CInfoClock::getInstance()->clear();
}
bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data)
@@ -1198,16 +1278,14 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data)
g_settings.show_menu_hints = * (int*) data;
return true;
}
else if((ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY)) ||
(ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_INFOBAR_SHOW_TUNER))) {
else if((ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY))
||(ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_INFOBAR_SHOW_TUNER))) {
if (g_InfoViewer == NULL)
g_InfoViewer = new CInfoViewer;
g_InfoViewer->changePB();
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY))
{
ca_dotmatrix->setActive(g_settings.casystem_display < 2);
ca_frame->setActive(g_settings.casystem_display < 2);
return true;
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY)){
casystemActivate.Activate(g_settings.infobar_casystem_display < 2);
return false;
}
return false;
}
@@ -1250,11 +1328,16 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data)
return false;
}
int COsdSetup::showContextChanlistMenu()
int COsdSetup::showContextChanlistMenu(CChannelList *parent_channellist)
{
static int cselected = -1;
CMenuWidget * menu_chanlist = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width);
//using native callback to ensure stop header clock in parent channellist before paint this menu window
if (parent_channellist && g_settings.menu_pos == CMenuWidget::MENU_POS_TOP_RIGHT)
menu_chanlist->OnBeforePaint.connect(sigc::mem_fun(parent_channellist->getHeaderObject()->getClockObject(), &CComponentsFrmClock::block));
menu_chanlist->enableSaveScreen(true);
menu_chanlist->enableFade(false);
menu_chanlist->setSelected(cselected);
@@ -1366,7 +1449,7 @@ void COsdSetup::paintWindowSize(int w, int h)
if (win_demo == NULL) {
win_demo = new CComponentsShapeSquare(0, 0, 0, 0);
win_demo->setFrameThickness(8);
win_demo->setShadowOnOff(CC_SHADOW_OFF);
win_demo->disableShadow();
win_demo->setColorBody(COL_BACKGROUND);
win_demo->setColorFrame(COL_RED);
win_demo->doPaintBg(true);