infoviewer_bb: always show hdd fill level for a more uniform view; ...

mark undetected hdd fill level with a small line over the progressbar.
this avoids a "whole" in footer when gradient is active


Origin commit data
------------------
Branch: ni/coolstream
Commit: 96cb7f8b9b
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-12-11 (Mon, 11 Dec 2017)

Origin message was:
------------------
- infoviewer_bb: always show hdd fill level for a more uniform view; ...

mark undetected hdd fill level with a small line over the progressbar.
this avoids a "whole" in footer when gradient is active


------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2017-12-11 21:59:44 +01:00
parent 5da51d316a
commit 98c3162b22

View File

@@ -689,24 +689,28 @@ void CInfoViewerBB::showIcon_Tuner()
void CInfoViewerBB::showSysfsHdd() void CInfoViewerBB::showSysfsHdd()
{ {
if (g_settings.infobar_show_sysfs_hdd) { if (g_settings.infobar_show_sysfs_hdd)
//sysFS info {
// sysfs info
int percent = 0; int percent = 0;
uint64_t t, u; uint64_t t, u;
if (get_fs_usage("/", t, u)) if (get_fs_usage("/", t, u))
percent = (int)((u * 100ULL) / t); percent = (int)((u * 100ULL) / t);
showBarSys(percent); showBarSys(percent);
// hdd info
showBarHdd(cHddStat::getInstance()->getPercent()); showBarHdd(cHddStat::getInstance()->getPercent());
} }
} }
void CInfoViewerBB::showBarSys(int percent) void CInfoViewerBB::showBarSys(int percent)
{ {
if (is_visible){ if (is_visible)
{
int sysscale_height = InfoHeightY_Info/4;
sysscale->reset(); sysscale->reset();
sysscale->doPaintBg(false); sysscale->doPaintBg(false);
sysscale->setDimensionsAll(bbIconMinX, BBarY + InfoHeightY_Info/2 - OFFSET_INNER_MIN - InfoHeightY_Info/4, hddwidth, InfoHeightY_Info/4); sysscale->setDimensionsAll(bbIconMinX, BBarY + InfoHeightY_Info/2 - OFFSET_INNER_MIN - sysscale_height, hddwidth, sysscale_height);
sysscale->setValues(percent, 100); sysscale->setValues(percent, 100);
sysscale->paint(); sysscale->paint();
} }
@@ -714,15 +718,19 @@ void CInfoViewerBB::showBarSys(int percent)
void CInfoViewerBB::showBarHdd(int percent) void CInfoViewerBB::showBarHdd(int percent)
{ {
if (is_visible) { if (is_visible)
{
int hddscale_height = InfoHeightY_Info/4;
hddscale->reset(); hddscale->reset();
hddscale->doPaintBg(false); hddscale->doPaintBg(false);
if (percent >= 0){ hddscale->setDimensionsAll(bbIconMinX, BBarY + InfoHeightY_Info/2 + OFFSET_INNER_MIN, hddwidth, hddscale_height);
hddscale->setDimensionsAll(bbIconMinX, BBarY + InfoHeightY_Info/2 + OFFSET_INNER_MIN, hddwidth, InfoHeightY_Info/4); hddscale->setValues(percent, 100);
hddscale->setValues(percent, 100); hddscale->paint();
hddscale->paint();
}else { if (percent < 0)
frameBuffer->paintBoxRel(bbIconMinX, BBarY + InfoHeightY_Info/2 + OFFSET_INNER_MIN, hddwidth, InfoHeightY_Info/4, COL_INFOBAR_BUTTONS_BACKGROUND); {
// mark undetected hdd fill level strike through
frameBuffer->paintHLineRel(bbIconMinX, hddwidth, BBarY + InfoHeightY_Info/2 + OFFSET_INNER_MIN + hddscale_height/2, COL_INFOBAR_BUTTONS_BACKGROUND);
} }
} }
} }