dboxinfo: right align (instead of centering) disk and mem values

This commit is contained in:
Stefan Seyfried
2013-12-30 01:16:08 +01:00
parent e4b0224f77
commit de72220951

View File

@@ -425,10 +425,10 @@ void CDBoxInfoWidget::paint()
// paint mount head // paint mount head
for (int j = 0; j < headSize_mem; j++) { for (int j = 0; j < headSize_mem; j++) {
headOffset = offsets[j]; headOffset = offsets[j];
int center = 0; int align = 0;
if (j > 0) if (j > 0)
center = (widths[j] - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(head_mem[j], true))/2; align = (widths[j] - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(head_mem[j], true));
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ headOffset + center, ypos+ mheight, width - 10, head_mem[j], COL_MENUCONTENTINACTIVE_TEXT); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ headOffset + align, ypos+ mheight, width - 10, head_mem[j], COL_MENUCONTENTINACTIVE_TEXT);
} }
ypos += mheight; ypos += mheight;
@@ -454,10 +454,10 @@ void CDBoxInfoWidget::paint()
break; break;
} }
mpOffset = offsets[j]; mpOffset = offsets[j];
int center = 0; int align = 0;
if (j > 0) if (j > 0)
center = (widths[j] - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true))/2; align = (widths[j] - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true));
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + mpOffset + center, ypos+ mheight, width - 10, tmp, COL_MENUCONTENT_TEXT); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + mpOffset + align, ypos+ mheight, width - 10, tmp, COL_MENUCONTENT_TEXT);
} }
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 ;) */
@@ -475,10 +475,10 @@ void CDBoxInfoWidget::paint()
// paint mount head // paint mount head
for (int j = 0; j < headSize; j++) { for (int j = 0; j < headSize; j++) {
headOffset = offsets[j]; headOffset = offsets[j];
int center = 0; int align = 0;
if (j > 0) if (j > 0)
center = (widths[j] - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(head[j], true))/2; align = (widths[j] - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(head[j], true));
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ headOffset + center, ypos+ mheight, width - 10, head[j], COL_MENUCONTENTINACTIVE_TEXT); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ headOffset + align, ypos+ mheight, width - 10, head[j], COL_MENUCONTENTINACTIVE_TEXT);
} }
ypos += mheight; ypos += mheight;
@@ -521,10 +521,10 @@ void CDBoxInfoWidget::paint()
tmp = to_string(percent_used) + "%"; tmp = to_string(percent_used) + "%";
break; break;
} }
int center = 0; int align = 0;
if (j > 0) if (j > 0)
center = (widths[j] - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true))/2; align = (widths[j] - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp, true));
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + mpOffset + center, ypos+ mheight, _w - 10, tmp, COL_MENUCONTENT_TEXT); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + mpOffset + align, ypos+ mheight, _w - 10, tmp, COL_MENUCONTENT_TEXT);
if ((*it).second && icon_w>0 && icon_h>0) if ((*it).second && icon_w>0 && icon_h>0)
frameBuffer->paintIcon(NEUTRINO_ICON_REC, x + nameWidth - icon_w, ypos + (mheight/2 - icon_h/2)); frameBuffer->paintIcon(NEUTRINO_ICON_REC, x + nameWidth - icon_w, ypos + (mheight/2 - icon_h/2));
} }