From cce30fb30127f4c220d7f199d3aa0b2d81160878 Mon Sep 17 00:00:00 2001 From: micha-bbg Date: Tue, 7 Feb 2012 11:12:52 +0000 Subject: [PATCH] * 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 --- src/gui/infoviewer.cpp | 29 +++++++++++++++++++---------- src/gui/infoviewer.h | 2 +- src/gui/osd_setup.cpp | 11 ++++++++++- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 22c0ea7b9..b09c83c54 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -236,8 +236,18 @@ void CInfoViewer::changePB() const short red_bar = 40; const short yellow_bar = 70; 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) delete sigscale; 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, 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 { 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 @@ -1168,10 +1178,9 @@ void CInfoViewer::showIcon_Resolution() const } } } - 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, InfoHeightY_Info); - } + if (g_settings.infobar_show_res < 2) + frameBuffer->paintIcon(icon_name, BoxEndX - (icon_xres_width + 2*icon_large_width + 2*icon_small_width + 5*2), BBarY, + InfoHeightY_Info, 1, true, true, COL_INFOBAR_BUTTONS_BACKGROUND); } void CInfoViewer::showIcon_SubT() const @@ -1182,7 +1191,7 @@ void CInfoViewer::showIcon_SubT() const have_sub = true; 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 () @@ -1968,7 +1977,7 @@ void CInfoViewer::showButton_Audio () dd_icon = NEUTRINO_ICON_DD_GREY; 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() @@ -2241,7 +2250,7 @@ void CInfoViewer::paint_ca_icons(int caid, char * icon, int &icon_space_offset) 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, - InfoHeightY_Info); + InfoHeightY_Info, 1, true, true, COL_INFOBAR_BUTTONS_BACKGROUND); } void CInfoViewer::showIcon_CA_Status (int notfirst) diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index fca649661..a3490a47c 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -118,7 +118,6 @@ class CInfoViewer int lastsnr, lastsig, lasthdd, lastvar, lasttime; CProgressBar *snrscale, *sigscale, *hddscale, *varscale, *timescale; int hddwidth; - void changePB(); bool casysChange; bool channellogoChange; void paintBackground(int col_Numbox); @@ -183,6 +182,7 @@ class CInfoViewer int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data); void clearVirtualZapMode() {virtual_zap_mode = false;} + void changePB(); }; class CInfoViewerHandler : public CMenuTarget diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index b17dec81c..2bebb555e 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -603,7 +603,7 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_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 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)); @@ -633,6 +633,12 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) osd_menu->hide(); 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)) { int preset = * (int *) data; 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_EndY = g_settings.screen_preset ? g_settings.screen_EndY_lcd : g_settings.screen_EndY_crt; osd_menu->hide(); + if (g_InfoViewer == NULL) + g_InfoViewer = new CInfoViewer; + g_InfoViewer->changePB(); return true; } return false;