From b40b80a636bc16a23f88d1b8fa8c7df7a88080ea Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 30 Jan 2011 12:23:55 +0000 Subject: [PATCH] infoviewer: scale filesystem bars with screen width git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1083 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ca56d169085b233a4257c2ac9c1aeb9b16a09d02 Author: Stefan Seyfried Date: 2011-01-30 (Sun, 30 Jan 2011) ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 13 +++++++------ src/gui/infoviewer.h | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 201ab47e4..df4c34928 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -237,6 +237,7 @@ void CInfoViewer::changePB() const short yellow_bar = 70; const short green_bar = 100; + hddwidth = frameBuffer->getScreenWidth(true) * 10 / 128; /* 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); @@ -245,10 +246,10 @@ void CInfoViewer::changePB() snrscale = new CProgressBar(true, bar_width, 10, red_bar, green_bar, yellow_bar); if (hddscale != NULL) delete hddscale; - hddscale = new CProgressBar(true, 100, 6, 50, green_bar, 75, true); + hddscale = new CProgressBar(true, hddwidth, 6, 50, green_bar, 75, true); if (varscale != NULL) delete varscale; - varscale = new CProgressBar(true, 100, 6, 50, green_bar, 75, true); + varscale = new CProgressBar(true, hddwidth, 6, 50, green_bar, 75, true); if (timescale != NULL) delete timescale; timescale = new CProgressBar(true, -1, -1, 30, green_bar, yellow_bar, true); @@ -1336,8 +1337,8 @@ void CInfoViewer::showSNR () /* center the scales in the button bar. BBarY + InfoHeightY_Info / 2 is middle, scales are 6 pixels high, icons are 16 pixels, so keep 4 pixels free between the scales */ - varscale->paintProgressBar(BoxEndX - (((g_settings.casystem_display !=2) ? 0:icon_crypt_width )+ icon_xres_width + 2*icon_large_width + 2*icon_small_width + ((g_settings.casystem_display !=2) ?5:6)*2) - 102, - BBarY + InfoHeightY_Info / 2 - 2 - 6, 100, 6, per, 100); + varscale->paintProgressBar(BoxEndX - (((g_settings.casystem_display !=2) ? 0:icon_crypt_width )+ icon_xres_width + 2*icon_large_width + 2*icon_small_width + ((g_settings.casystem_display !=2) ?5:6)*2) - hddwidth - 2, + BBarY + InfoHeightY_Info / 2 - 2 - 6, hddwidth , 6, per, 100); per = 0; //HD info if(!check_dir(g_settings.network_nfs_recordingdir)){ @@ -1345,8 +1346,8 @@ void CInfoViewer::showSNR () per = (s.f_blocks - s.f_bfree) / (s.f_blocks/100); } } - hddscale->paintProgressBar(BoxEndX - (((g_settings.casystem_display !=2) ? 0:icon_crypt_width )+ icon_xres_width + 2*icon_large_width + 2*icon_small_width + ((g_settings.casystem_display !=2) ?5:6)*2) - 102, - BBarY + InfoHeightY_Info / 2 + 2, 100, 6, per, 100); + hddscale->paintProgressBar(BoxEndX - (((g_settings.casystem_display !=2) ? 0:icon_crypt_width )+ icon_xres_width + 2*icon_large_width + 2*icon_small_width + ((g_settings.casystem_display !=2) ?5:6)*2) - hddwidth - 2, + BBarY + InfoHeightY_Info / 2 + 2, hddwidth, 6, per, 100); } } diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index 23c251c4b..b0df444a3 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -108,6 +108,7 @@ class CInfoViewer int lastsnr, lastsig, lasthdd, lastvar, lasttime; CProgressBar *snrscale, *sigscale, *hddscale, *varscale, *timescale; + int hddwidth; void changePB(); bool casysChange; bool channellogoChange;