mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
* Custom Menu Icons
- Use paint background to draw the icons in the info bar. - Scale down var/hdd fill level in the info bar if larger icons are used. - No change to use the original icons. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2083 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -236,8 +236,18 @@ void CInfoViewer::changePB()
|
|||||||
const short red_bar = 40;
|
const short red_bar = 40;
|
||||||
const short yellow_bar = 70;
|
const short yellow_bar = 70;
|
||||||
const short green_bar = 100;
|
const short green_bar = 100;
|
||||||
|
int w = 0, h = 0;
|
||||||
|
|
||||||
hddwidth = frameBuffer->getScreenWidth(true) * 10 / 128; /* 100 pix if screen is 1280 wide */
|
frameBuffer->getIconSize(NEUTRINO_ICON_16_9, &w, &h);
|
||||||
|
if (w > 26) { // larger icons
|
||||||
|
if (g_settings.screen_preset == 1)
|
||||||
|
w = (g_settings.casystem_display == 2) ? 6 : 10; // LCD
|
||||||
|
else
|
||||||
|
w = (g_settings.casystem_display == 2) ? 4 : 7; // CRT
|
||||||
|
}
|
||||||
|
else // org. icons
|
||||||
|
w = 10;
|
||||||
|
hddwidth = frameBuffer->getScreenWidth(true) * w / 128; /* 40...100 pix if screen is 1280 wide */
|
||||||
if (sigscale != NULL)
|
if (sigscale != NULL)
|
||||||
delete sigscale;
|
delete sigscale;
|
||||||
sigscale = new CProgressBar(true, bar_width, 10, red_bar, green_bar, yellow_bar);
|
sigscale = new CProgressBar(true, bar_width, 10, red_bar, green_bar, yellow_bar);
|
||||||
@@ -1078,14 +1088,14 @@ void CInfoViewer::showIcon_16_9 ()
|
|||||||
}
|
}
|
||||||
frameBuffer->paintIcon((aspectRatio > 2) ? NEUTRINO_ICON_16_9 : NEUTRINO_ICON_16_9_GREY,
|
frameBuffer->paintIcon((aspectRatio > 2) ? NEUTRINO_ICON_16_9 : NEUTRINO_ICON_16_9_GREY,
|
||||||
BoxEndX - (2*icon_large_width + 2*icon_small_width + 4*2), BBarY,
|
BoxEndX - (2*icon_large_width + 2*icon_small_width + 4*2), BBarY,
|
||||||
InfoHeightY_Info);
|
InfoHeightY_Info, 1, true, true, COL_INFOBAR_BUTTONS_BACKGROUND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInfoViewer::showIcon_VTXT () const
|
void CInfoViewer::showIcon_VTXT () const
|
||||||
{
|
{
|
||||||
frameBuffer->paintIcon((g_RemoteControl->current_PIDs.PIDs.vtxtpid != 0) ? NEUTRINO_ICON_VTXT : NEUTRINO_ICON_VTXT_GREY,
|
frameBuffer->paintIcon((g_RemoteControl->current_PIDs.PIDs.vtxtpid != 0) ? NEUTRINO_ICON_VTXT : NEUTRINO_ICON_VTXT_GREY,
|
||||||
BoxEndX - (2*icon_small_width + 2*2), BBarY, InfoHeightY_Info);
|
BoxEndX - (2*icon_small_width + 2*2), BBarY, InfoHeightY_Info, 1, true, true, COL_INFOBAR_BUTTONS_BACKGROUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInfoViewer::showIcon_Resolution() const
|
void CInfoViewer::showIcon_Resolution() const
|
||||||
@@ -1168,10 +1178,9 @@ void CInfoViewer::showIcon_Resolution() const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (g_settings.infobar_show_res < 2) {
|
if (g_settings.infobar_show_res < 2)
|
||||||
frameBuffer->paintBoxRel(BoxEndX - (icon_xres_width + 2*icon_large_width + 2*icon_small_width + 5*2), BBarY, icon_large_width, InfoHeightY_Info, COL_INFOBAR_BUTTONS_BACKGROUND, RADIUS_SMALL, CORNER_BOTTOM);
|
frameBuffer->paintIcon(icon_name, BoxEndX - (icon_xres_width + 2*icon_large_width + 2*icon_small_width + 5*2), BBarY,
|
||||||
frameBuffer->paintIcon(icon_name, BoxEndX - (icon_xres_width + 2*icon_large_width + 2*icon_small_width + 5*2), BBarY, InfoHeightY_Info);
|
InfoHeightY_Info, 1, true, true, COL_INFOBAR_BUTTONS_BACKGROUND);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInfoViewer::showIcon_SubT() const
|
void CInfoViewer::showIcon_SubT() const
|
||||||
@@ -1182,7 +1191,7 @@ void CInfoViewer::showIcon_SubT() const
|
|||||||
have_sub = true;
|
have_sub = true;
|
||||||
|
|
||||||
frameBuffer->paintIcon(have_sub ? NEUTRINO_ICON_SUBT : NEUTRINO_ICON_SUBT_GREY, BoxEndX - (icon_small_width + 2),
|
frameBuffer->paintIcon(have_sub ? NEUTRINO_ICON_SUBT : NEUTRINO_ICON_SUBT_GREY, BoxEndX - (icon_small_width + 2),
|
||||||
BBarY, InfoHeightY_Info);
|
BBarY, InfoHeightY_Info, 1, true, true, COL_INFOBAR_BUTTONS_BACKGROUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInfoViewer::showFailure ()
|
void CInfoViewer::showFailure ()
|
||||||
@@ -1968,7 +1977,7 @@ void CInfoViewer::showButton_Audio ()
|
|||||||
dd_icon = NEUTRINO_ICON_DD_GREY;
|
dd_icon = NEUTRINO_ICON_DD_GREY;
|
||||||
|
|
||||||
frameBuffer->paintIcon(dd_icon, BoxEndX - (icon_large_width + 2*icon_small_width + 3*2),
|
frameBuffer->paintIcon(dd_icon, BoxEndX - (icon_large_width + 2*icon_small_width + 3*2),
|
||||||
BBarY, InfoHeightY_Info);
|
BBarY, InfoHeightY_Info, 1, true, true, COL_INFOBAR_BUTTONS_BACKGROUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInfoViewer::killTitle()
|
void CInfoViewer::killTitle()
|
||||||
@@ -2241,7 +2250,7 @@ void CInfoViewer::paint_ca_icons(int caid, char * icon, int &icon_space_offset)
|
|||||||
void CInfoViewer::showOne_CAIcon(bool fta)
|
void CInfoViewer::showOne_CAIcon(bool fta)
|
||||||
{
|
{
|
||||||
frameBuffer->paintIcon(fta ? NEUTRINO_ICON_SCRAMBLED2_GREY : NEUTRINO_ICON_SCRAMBLED2, BoxEndX - (icon_xres_width + icon_crypt_width + 2*icon_large_width + 2*icon_small_width + 6*2), BBarY,
|
frameBuffer->paintIcon(fta ? NEUTRINO_ICON_SCRAMBLED2_GREY : NEUTRINO_ICON_SCRAMBLED2, BoxEndX - (icon_xres_width + icon_crypt_width + 2*icon_large_width + 2*icon_small_width + 6*2), BBarY,
|
||||||
InfoHeightY_Info);
|
InfoHeightY_Info, 1, true, true, COL_INFOBAR_BUTTONS_BACKGROUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInfoViewer::showIcon_CA_Status (int notfirst)
|
void CInfoViewer::showIcon_CA_Status (int notfirst)
|
||||||
|
@@ -118,7 +118,6 @@ class CInfoViewer
|
|||||||
int lastsnr, lastsig, lasthdd, lastvar, lasttime;
|
int lastsnr, lastsig, lasthdd, lastvar, lasttime;
|
||||||
CProgressBar *snrscale, *sigscale, *hddscale, *varscale, *timescale;
|
CProgressBar *snrscale, *sigscale, *hddscale, *varscale, *timescale;
|
||||||
int hddwidth;
|
int hddwidth;
|
||||||
void changePB();
|
|
||||||
bool casysChange;
|
bool casysChange;
|
||||||
bool channellogoChange;
|
bool channellogoChange;
|
||||||
void paintBackground(int col_Numbox);
|
void paintBackground(int col_Numbox);
|
||||||
@@ -183,6 +182,7 @@ class CInfoViewer
|
|||||||
|
|
||||||
int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data);
|
int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data);
|
||||||
void clearVirtualZapMode() {virtual_zap_mode = false;}
|
void clearVirtualZapMode() {virtual_zap_mode = false;}
|
||||||
|
void changePB();
|
||||||
};
|
};
|
||||||
|
|
||||||
class CInfoViewerHandler : public CMenuTarget
|
class CInfoViewerHandler : public CMenuTarget
|
||||||
|
@@ -603,7 +603,7 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar)
|
|||||||
{
|
{
|
||||||
menu_infobar->addIntroItems(LOCALE_MISCSETTINGS_INFOBAR);
|
menu_infobar->addIntroItems(LOCALE_MISCSETTINGS_INFOBAR);
|
||||||
|
|
||||||
menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY, &g_settings.casystem_display, INFOBAR_CASYSTEM_MODE_OPTIONS, INFOBAR_CASYSTEM_MODE_OPTION_COUNT, true));
|
menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY, &g_settings.casystem_display, INFOBAR_CASYSTEM_MODE_OPTIONS, INFOBAR_CASYSTEM_MODE_OPTION_COUNT, true, this));
|
||||||
menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_DISP_LOG, &g_settings.infobar_show_channellogo, LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS, LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS_COUNT, true));
|
menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_DISP_LOG, &g_settings.infobar_show_channellogo, LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS, LOCALE_MISCSETTINGS_INFOBAR_DISP_OPTIONS_COUNT, true));
|
||||||
menu_infobar->addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_INFOBAR_LOGO_HDD_DIR, true, g_settings.logo_hdd_dir, this, "logo_dir"));
|
menu_infobar->addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_INFOBAR_LOGO_HDD_DIR, true, g_settings.logo_hdd_dir, this, "logo_dir"));
|
||||||
menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SAT_DISPLAY, &g_settings.infobar_sat_display, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
menu_infobar->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_SAT_DISPLAY, &g_settings.infobar_sat_display, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
|
||||||
@@ -633,6 +633,12 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data)
|
|||||||
osd_menu->hide();
|
osd_menu->hide();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_INFOBAR_CASYSTEM_DISPLAY)) {
|
||||||
|
if (g_InfoViewer == NULL)
|
||||||
|
g_InfoViewer = new CInfoViewer;
|
||||||
|
g_InfoViewer->changePB();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_OSD_PRESET)) {
|
else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_OSD_PRESET)) {
|
||||||
int preset = * (int *) data;
|
int preset = * (int *) data;
|
||||||
printf("preset %d (setting %d)\n", preset, g_settings.screen_preset);
|
printf("preset %d (setting %d)\n", preset, g_settings.screen_preset);
|
||||||
@@ -642,6 +648,9 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data)
|
|||||||
g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt;
|
g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_lcd : g_settings.screen_EndX_crt;
|
||||||
g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt;
|
g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt;
|
||||||
osd_menu->hide();
|
osd_menu->hide();
|
||||||
|
if (g_InfoViewer == NULL)
|
||||||
|
g_InfoViewer = new CInfoViewer;
|
||||||
|
g_InfoViewer->changePB();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user