diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp index fafa46423..65b9252c2 100644 --- a/src/gui/dboxinfo.cpp +++ b/src/gui/dboxinfo.cpp @@ -210,10 +210,9 @@ void CDBoxInfoWidget::paint() height += mheight/2; // space int frontend_count = CFEManager::getInstance()->getFrontendCount(); - if (frontend_count) { - height += mheight * frontend_count; - height += mheight/2; - } + if (frontend_count > 2) + height += mheight * (frontend_count - 2); + height += mheight/2; int icon_w = 0, icon_h = 0; frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icon_w, &icon_h); @@ -355,22 +354,28 @@ void CDBoxInfoWidget::paint() char ubuf[80]; time_t now = time(NULL); strftime(ubuf, sizeof(ubuf), "Time: %F %H:%M:%S%z", localtime(&now)); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width - 10, ubuf, COL_MENUCONTENT_TEXT); - ypos += mheight; + char ubuf_boot[80]; struct sysinfo info; sysinfo(&info); now -= info.uptime; - strftime(ubuf, sizeof(ubuf), "Boot: %F %H:%M:%S%z", localtime(&now)); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width - 10, ubuf, COL_MENUCONTENT_TEXT); + strftime(ubuf_boot, sizeof(ubuf_boot), "Boot: %FT%H:%M:%S%z", localtime(&now)); + + int time_width = std::max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(ubuf), g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(ubuf_boot)); + + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + offsetw - time_width - 10, ypos+ mheight, time_width, ubuf, COL_MENUCONTENT_TEXT); + ypos += mheight; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + offsetw - time_width - 10, ypos+ mheight, time_width, ubuf_boot, COL_MENUCONTENT_TEXT); ypos += mheight; if (data_last > -1) { snprintf(ubuf, sizeof(ubuf), "Load: %d%s%d%%", data_last/10, g_Locale->getText(LOCALE_UNIT_DECIMAL), data_last%10); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width - 10, ubuf, COL_MENUCONTENT_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + offsetw - time_width - 10, ypos+ mheight, time_width, ubuf, COL_MENUCONTENT_TEXT); } ypos += mheight; + int ypos_mem = ypos; + int pbw = width - offsetw - 10; if (pbw > 8) /* smaller progressbar is not useful ;) */ { @@ -386,21 +391,22 @@ void CDBoxInfoWidget::paint() } } - ypos += mheight/2; + ypos = y + hheight + mheight/2; - if (frontend_count) { - for (int i = 0; i < frontend_count; i++) { - CFrontend *fe = CFEManager::getInstance()->getFE(i); - if (fe) { - std::string s("Frontend "); - s += to_string(i) + ": " + fe->getInfo()->name; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width - 10, s, COL_MENUCONTENT_TEXT); - ypos += mheight; - } + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + 10, ypos + mheight, width - 10, "Frontends", COL_MENUCONTENTINACTIVE_TEXT); + ypos += mheight; + for (int i = 0; i < frontend_count; i++) { + CFrontend *fe = CFEManager::getInstance()->getFE(i); + if (fe) { + std::string s = to_string(i) + ": " + fe->getInfo()->name; + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+ 10, ypos+ mheight, width - 10, s, COL_MENUCONTENT_TEXT); + ypos += mheight; } - ypos += mheight/2; } + ypos = std::max(ypos, ypos_mem); + ypos += mheight/2; + int headOffset=0; int mpOffset=0; int offsets[] = {