mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 01:41:12 +02:00
dboxinfo.cpp: fix progressbar offset
Origin commit data
------------------
Commit: 8055c0fbe2
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2014-09-26 (Fri, 26 Sep 2014)
This commit is contained in:
committed by
[CST] Focus
parent
aff21b9468
commit
526acd76d9
@@ -431,7 +431,7 @@ void CDBoxInfoWidget::paint()
|
|||||||
ypos += mheight;
|
ypos += mheight;
|
||||||
|
|
||||||
int ypos_mem = ypos;
|
int ypos_mem = ypos;
|
||||||
|
int pbw_fix = 0;
|
||||||
int pbw = width - offsetw - 10;
|
int pbw = width - offsetw - 10;
|
||||||
if (pbw > 8) /* smaller progressbar is not useful ;) */
|
if (pbw > 8) /* smaller progressbar is not useful ;) */
|
||||||
{
|
{
|
||||||
@@ -508,12 +508,14 @@ void CDBoxInfoWidget::paint()
|
|||||||
int rw = fm->getRenderWidth(tmp);
|
int rw = fm->getRenderWidth(tmp);
|
||||||
maxWidth[column] = std::max(maxWidth[column], rw);
|
maxWidth[column] = std::max(maxWidth[column], rw);
|
||||||
space = widths[column] - rw;
|
space = widths[column] - rw;
|
||||||
|
if( (mpOffset + rw + space) > offsetw)
|
||||||
|
pbw_fix = ((mpOffset + rw + space + 10) - offsetw);
|
||||||
}
|
}
|
||||||
fm->RenderString(x + mpOffset + space, ypos+ mheight, width, tmp, COL_MENUCONTENT_TEXT);
|
fm->RenderString(x + mpOffset + space, ypos+ mheight, width, tmp, COL_MENUCONTENT_TEXT);
|
||||||
}
|
}
|
||||||
if (pbw > 8) /* smaller progressbar is not useful ;) */
|
if (pbw-pbw_fix > 8) /* smaller progressbar is not useful ;) */
|
||||||
{
|
{
|
||||||
CProgressBar pb(x+offsetw, ypos+mheight/4, pbw, mheight/2);
|
CProgressBar pb(x+offsetw+pbw_fix, ypos+mheight/4, pbw-pbw_fix, mheight/2);
|
||||||
pb.setType(CProgressBar::PB_REDRIGHT);
|
pb.setType(CProgressBar::PB_REDRIGHT);
|
||||||
pb.setValues(memstat[row][MEMINFO_TOTAL] ? (memstat[row][MEMINFO_USED] * 100) / memstat[row][MEMINFO_TOTAL] : 0, 100);
|
pb.setValues(memstat[row][MEMINFO_TOTAL] ? (memstat[row][MEMINFO_USED] * 100) / memstat[row][MEMINFO_TOTAL] : 0, 100);
|
||||||
pb.paint(false);
|
pb.paint(false);
|
||||||
@@ -577,9 +579,9 @@ void CDBoxInfoWidget::paint()
|
|||||||
if ((*it).second && icon_w>0 && icon_h>0)
|
if ((*it).second && icon_w>0 && icon_h>0)
|
||||||
frameBuffer->paintIcon(crm->RecordingStatus() ? NEUTRINO_ICON_REC:NEUTRINO_ICON_REC_GRAY, x + nameWidth - icon_w + width_i/2, ypos + (mheight/2 - icon_h/2));
|
frameBuffer->paintIcon(crm->RecordingStatus() ? NEUTRINO_ICON_REC:NEUTRINO_ICON_REC_GRAY, x + nameWidth - icon_w + width_i/2, ypos + (mheight/2 - icon_h/2));
|
||||||
}
|
}
|
||||||
if (pbw > 8) /* smaller progressbar is not useful ;) */
|
if (pbw-pbw_fix > 8) /* smaller progressbar is not useful ;) */
|
||||||
{
|
{
|
||||||
CProgressBar pb(x+offsetw, ypos+mheight/4, pbw, mheight/2);
|
CProgressBar pb(x+offsetw+pbw_fix, ypos+mheight/4, pbw-pbw_fix, mheight/2);
|
||||||
pb.setType(CProgressBar::PB_REDRIGHT);
|
pb.setType(CProgressBar::PB_REDRIGHT);
|
||||||
pb.setValues(percent_used, 100);
|
pb.setValues(percent_used, 100);
|
||||||
pb.paint(false);
|
pb.paint(false);
|
||||||
|
Reference in New Issue
Block a user