From 35be383b8a7e7d2022aafd0214a9a0dc7e5d7097 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 3 Mar 2017 19:00:39 +0100 Subject: [PATCH 1/4] imageinfo_ni: avoid multiple cs_get_revision() calls; ... fix small typo Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1100110913abbf03481eff832d379bfb85a10746 Author: vanhofen Date: 2017-03-03 (Fri, 03 Mar 2017) Origin message was: ------------------ - imageinfo_ni: avoid multiple cs_get_revision() calls; ... fix small typo --- src/gui/imageinfo_ni.cpp | 5 +++-- src/gui/imageinfo_ni.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/imageinfo_ni.cpp b/src/gui/imageinfo_ni.cpp index ee4d1704c..b33025808 100644 --- a/src/gui/imageinfo_ni.cpp +++ b/src/gui/imageinfo_ni.cpp @@ -115,6 +115,7 @@ void CImageInfoNI::Init(void) y = getScreenStartY( height ); systemfs = 0; + revision = cs_get_revision(); old_x = 0; old_y = 0; InfoThread = 0; @@ -369,7 +370,7 @@ void* CImageInfoNI::InfoProc(void *arg) void CImageInfoNI::StartInfoThread() { if(!InfoThread) { - printf("CImageInfoNI::StartInfoThrea\n"); + printf("CImageInfoNI::StartInfoThread\n"); pthread_create (&InfoThread, NULL, InfoProc, (void*) this) ; pthread_detach(InfoThread); } @@ -847,7 +848,7 @@ void CImageInfoNI::paint_NET_Info(int posx, int posy) */ #ifdef BOXMODEL_CS_HD2 int max_bit = 104857600; /* Shiner, Kronos */ - if (cs_get_revision() == 9) + if (revision == 9) max_bit = 1073741824; /* Apollo */ #else int max_bit = 104857600; diff --git a/src/gui/imageinfo_ni.h b/src/gui/imageinfo_ni.h index c889445d8..2ecd32cca 100644 --- a/src/gui/imageinfo_ni.h +++ b/src/gui/imageinfo_ni.h @@ -109,6 +109,7 @@ class CImageInfoNI : public CMenuTarget void StopInfoThread(); int systemfs; + int revision; int old_x; int old_y; From 42c56bbdaa2dccc648e109f1f473610b27bbb615 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 3 Mar 2017 19:00:40 +0100 Subject: [PATCH 2/4] imageinfo_ni: use OFFSET-defines; auto-calc info_items struct Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c75624cdad6890551aa94c12ca12cf0ceda588ca Author: vanhofen Date: 2017-03-03 (Fri, 03 Mar 2017) Origin message was: ------------------ - imageinfo_ni: use OFFSET-defines; auto-calc info_items struct --- src/gui/imageinfo_ni.cpp | 70 ++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/gui/imageinfo_ni.cpp b/src/gui/imageinfo_ni.cpp index b33025808..e68e0d65d 100644 --- a/src/gui/imageinfo_ni.cpp +++ b/src/gui/imageinfo_ni.cpp @@ -2,7 +2,7 @@ imageinfo_ni (C) 2009-2016 NG-Team - (C) 2016 NI-Team + (C) 2016,2017 NI-Team License: GPL @@ -81,7 +81,7 @@ CImageInfoNI::CImageInfoNI() Init(); } -static const neutrino_locale_t info_items[8] = +static const neutrino_locale_t info_items[] = { LOCALE_IMAGEINFO_IMAGE, LOCALE_IMAGEINFO_DATE, @@ -92,6 +92,7 @@ static const neutrino_locale_t info_items[8] = LOCALE_IMAGEINFO_FORUM, LOCALE_IMAGEINFO_LICENSE }; +int info_items_count = sizeof(info_items)/sizeof(info_items[0]); void CImageInfoNI::Init(void) { @@ -109,10 +110,10 @@ void CImageInfoNI::Init(void) max_width = frameBuffer->getScreenWidth(true); max_height = frameBuffer->getScreenHeight(true); - width = frameBuffer->getScreenWidth() - 10; - height = frameBuffer->getScreenHeight() - 10; - x = getScreenStartX( width ); - y = getScreenStartY( height ); + width = frameBuffer->getScreenWidth() - 2*OFFSET_INNER_MID; + height = frameBuffer->getScreenHeight() - 2*OFFSET_INNER_MID; + x = getScreenStartX(width); + y = getScreenStartY(height); systemfs = 0; revision = cs_get_revision(); @@ -122,18 +123,17 @@ void CImageInfoNI::Init(void) read_old = 0; write_old = 0; net_best = 0; - xcpu = width - width/3 - 10; - ycpu = y + 10 + (height/3 /* pig-box height */) + (2 * iheight); - max_text_width = xcpu - x - 2*10; + xcpu = width - width/3 - OFFSET_INNER_MID; + ycpu = y + OFFSET_INNER_MID + (height/3 /* pig-box height */) + (2 * iheight); + max_text_width = xcpu - x - 2*OFFSET_INNER_MID; offset = 0; - for (int i = 0; i < 8; i++) { - int tmpoffset = g_Font[font_info]->getRenderWidth(g_Locale->getText (info_items[i])); - if (tmpoffset > offset) { + for (int i = 0; i < info_items_count; i++) { + int tmpoffset = g_Font[font_info]->getRenderWidth(g_Locale->getText(info_items[i])); + if (tmpoffset > offset) offset = tmpoffset; - } } - offset = offset + 15; + offset = offset + OFFSET_INNER_MID; } CImageInfoNI::~CImageInfoNI() @@ -163,7 +163,7 @@ int CImageInfoNI::exec(CMenuTarget* parent, const std::string &) fader.StartFadeIn(); bool fadeout = false; paint(); - paint_pig(xcpu, y + 10, width/3, height/3); + paint_pig(xcpu, y + OFFSET_INNER_MID, width/3, height/3); StartInfoThread(); while (1) @@ -244,7 +244,7 @@ void CImageInfoNI::hide() void CImageInfoNI::paint_pig(int px, int py, int w, int h) { - frameBuffer->paintBoxRel(px-10,py-10,w+20,h+20, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(px - OFFSET_INNER_MID, py - OFFSET_INNER_MID, w + 2*OFFSET_INNER_MID, h + 2*OFFSET_INNER_MID, COL_INFOBAR_PLUS_0); g_PicViewer->DisplayImage(ICONSDIR "/start.jpg", px, py, w, h, frameBuffer->TM_NONE); } @@ -262,7 +262,7 @@ void CImageInfoNI::clearLine(int xpos, int font) void CImageInfoNI::paint() { const char * head_string; - int xpos = x+10; + int xpos = x + OFFSET_INNER_MID; ypos = y; @@ -360,8 +360,8 @@ void* CImageInfoNI::InfoProc(void *arg) CImageInfoNI *imageInfo = (CImageInfoNI*) arg; while(1) { - imageInfo->paint_MEM_Info(imageInfo->x+10, imageInfo->ypos); - imageInfo->paint_NET_Info(imageInfo->x+10, imageInfo->ypos); + imageInfo->paint_MEM_Info(imageInfo->x + OFFSET_INNER_MID, imageInfo->ypos); + imageInfo->paint_NET_Info(imageInfo->x + OFFSET_INNER_MID, imageInfo->ypos); sleep(1); } return 0; @@ -525,7 +525,7 @@ int CImageInfoNI::CPU_Percent(_stat *cpu) void CImageInfoNI::paint_Stat_Info_Box(int InfoB_x, int InfoB_y, int InfoB_w, int InfoB_h) { - frameBuffer->paintBoxRel(InfoB_x-10,InfoB_y-10,InfoB_w+20,InfoB_h+20, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(InfoB_x - OFFSET_INNER_MID, InfoB_y - OFFSET_INNER_MID, InfoB_w + 2*OFFSET_INNER_MID, InfoB_h + 2*OFFSET_INNER_MID, COL_INFOBAR_PLUS_0); g_Font[font_info]->RenderString(InfoB_x, InfoB_y, InfoB_w, "CPU-Load", COL_INFOBAR_TEXT); sigBox_x = InfoB_x; @@ -610,10 +610,10 @@ void CImageInfoNI::get_DF_Info() void CImageInfoNI::paint_DF_Info(int posx) { std::ostringstream buf; - int boxH = sheight-4; + int boxH = sheight - 2*OFFSET_INNER_MIN; int boxW = swidth*8; - int boxX = posx+width/3-boxW; - int boxY = ypos-sheight+2; + int boxX = posx + width/3 - boxW; + int boxY = ypos - sheight + OFFSET_INNER_MIN; get_DF_Info(); @@ -707,17 +707,17 @@ void CImageInfoNI::paint_MEM_Info(int posx, int posy) posy += sheight/2; - int boxH = sheight-4; + int boxH = sheight - 2*OFFSET_INNER_MIN; int boxW = swidth*8; - int boxX = posx+width/3-boxW; - int boxY = posy-sheight+2; + int boxX = posx + width/3 - boxW; + int boxY = posy - sheight + OFFSET_INNER_MIN ; get_MEM_Info(); int mem_percent = get_MEM_Percent(mem_info.total, mem_info.used); buf << "Memory (" << mem_percent << " Percent):"; // progressbar ist in same line - so we not can use max_text_width - frameBuffer->paintBoxRel(posx-10,posy-sheight,boxX-posx+10,sheight, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(posx - OFFSET_INNER_MID, posy - sheight, boxX - posx + OFFSET_INNER_MID, sheight, COL_INFOBAR_PLUS_0); g_Font[font_small]->RenderString(posx, posy, boxX-posx, buf.str().c_str(), COL_INFOBAR_TEXT); CProgressBar pb(boxX, boxY, boxW, boxH); @@ -731,7 +731,7 @@ void CImageInfoNI::paint_MEM_Info(int posx, int posy) buf.str(""); buf.precision(2); buf << fixed << "Total: " << (mem_info.total/1024.0) << " MB Used: " << (mem_info.used/1024.0) << " MB"; - frameBuffer->paintBoxRel(posx-10,posy-sheight,max_text_width+10,sheight, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(posx - OFFSET_INNER_MID, posy - sheight, max_text_width + OFFSET_INNER_MID, sheight, COL_INFOBAR_PLUS_0); g_Font[font_small]->RenderString(posx, posy, max_text_width, buf.str().c_str(), COL_INFOBAR_TEXT); posy+= sheight; @@ -743,7 +743,7 @@ void CImageInfoNI::paint_MEM_Info(int posx, int posy) << "Cached: " << (mem_info.cached < 1024 ? mem_info.cached : (mem_info.cached/1024.0)) << (mem_info.cached < 1024?" KB":" MB)"); - frameBuffer->paintBoxRel(posx-10,posy-sheight,max_text_width+10,sheight, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(posx - OFFSET_INNER_MID, posy - sheight, max_text_width + OFFSET_INNER_MID, sheight, COL_INFOBAR_PLUS_0); g_Font[font_small]->RenderString(posx, posy, max_text_width, buf.str().c_str(), COL_INFOBAR_TEXT); } @@ -806,10 +806,10 @@ void CImageInfoNI::paint_NET_Info(int posx, int posy) posy += sheight/2; posy += 3*sheight + sheight/2; //height meminfo above that - int boxH = sheight-4; + int boxH = sheight - 2*OFFSET_INNER_MIN; int boxW = swidth*8; - int boxX = posx+width/3-boxW; - int boxY = posy-sheight+2; + int boxX = posx + width/3 - boxW; + int boxY = posy - sheight + OFFSET_INNER_MIN ; /* * write testing: @@ -872,7 +872,7 @@ void CImageInfoNI::paint_NET_Info(int posx, int posy) sprintf(temp_string,"Interface eth0 (%d%%):",percent); // progressbar ist in same line - so we not can use max_text_width - frameBuffer->paintBoxRel(posx-10,posy-sheight,boxX-posx+10,sheight, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(posx - OFFSET_INNER_MID, posy - sheight, boxX - posx + OFFSET_INNER_MID, sheight, COL_INFOBAR_PLUS_0); g_Font[font_small]->RenderString(posx, posy, boxX-posx, temp_string, COL_INFOBAR_TEXT); CProgressBar pb(boxX, boxY, boxW, boxH); @@ -885,13 +885,13 @@ void CImageInfoNI::paint_NET_Info(int posx, int posy) posy+= sheight; sprintf(temp_string,"Receive: %llu bit/s Transmit: %llu bit/s",(long long unsigned int)rbit_s,(long long unsigned int)wbit_s); - frameBuffer->paintBoxRel(posx-10,posy-sheight,max_text_width+10,sheight, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(posx - OFFSET_INNER_MID, posy - sheight, max_text_width + OFFSET_INNER_MID, sheight, COL_INFOBAR_PLUS_0); g_Font[font_small]->RenderString(posx, posy, max_text_width, temp_string, COL_INFOBAR_TEXT); posy+= sheight; sprintf(temp_string,"Maximal: %llu bit/s - %.2f MB/s (%d%%)",(long long unsigned int)net_best,net_best/(8.0*1024.0*1024.0),(int)((net_best*100)/max_bit)); - frameBuffer->paintBoxRel(posx-10,posy-sheight,max_text_width+10,sheight, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(posx - OFFSET_INNER_MID, posy - sheight, max_text_width + OFFSET_INNER_MID, sheight, COL_INFOBAR_PLUS_0); g_Font[font_small]->RenderString(posx, posy, max_text_width, temp_string, COL_INFOBAR_TEXT); last_tv.tv_sec = tv.tv_sec; From 331ac05e5102188c138c6db8dab01e7b68bb6b08 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 3 Mar 2017 19:00:40 +0100 Subject: [PATCH 3/4] imageinfo_ni: cleanup info_items struct; ... remove obsolete videoDecoder calls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6039c66423bcaf71ea51a1bc5251ef805b8b3e7d Author: vanhofen Date: 2017-03-03 (Fri, 03 Mar 2017) Origin message was: ------------------ - imageinfo_ni: cleanup info_items struct; ... remove obsolete videoDecoder calls --- src/gui/imageinfo_ni.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/gui/imageinfo_ni.cpp b/src/gui/imageinfo_ni.cpp index e68e0d65d..f45f6b19b 100644 --- a/src/gui/imageinfo_ni.cpp +++ b/src/gui/imageinfo_ni.cpp @@ -58,8 +58,6 @@ #include -extern cVideo * videoDecoder; - extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ #include @@ -84,13 +82,14 @@ CImageInfoNI::CImageInfoNI() static const neutrino_locale_t info_items[] = { LOCALE_IMAGEINFO_IMAGE, - LOCALE_IMAGEINFO_DATE, LOCALE_IMAGEINFO_VERSION, + /* Commit: */ + LOCALE_IMAGEINFO_KERNEL, + /* Lua-API: */ + /* yWeb: */ + LOCALE_IMAGEINFO_DATE, LOCALE_IMAGEINFO_CREATOR, - LOCALE_IMAGEINFO_HOMEPAGE, - LOCALE_IMAGEINFO_DOKUMENTATION, - LOCALE_IMAGEINFO_FORUM, - LOCALE_IMAGEINFO_LICENSE + LOCALE_IMAGEINFO_HOMEPAGE }; int info_items_count = sizeof(info_items)/sizeof(info_items[0]); @@ -139,7 +138,6 @@ void CImageInfoNI::Init(void) CImageInfoNI::~CImageInfoNI() { StopInfoThread(); - videoDecoder->Pig(-1, -1, -1, -1); } int CImageInfoNI::exec(CMenuTarget* parent, const std::string &) @@ -239,7 +237,6 @@ int CImageInfoNI::exec(CMenuTarget* parent, const std::string &) void CImageInfoNI::hide() { frameBuffer->paintBackground(); - videoDecoder->Pig(-1, -1, -1, -1); } void CImageInfoNI::paint_pig(int px, int py, int w, int h) @@ -313,7 +310,7 @@ void CImageInfoNI::paint() struct utsname uts_info; ypos += iheight; - paintLine(xpos, font_info, "Kernel:"); + paintLine(xpos, font_info, g_Locale->getText(LOCALE_IMAGEINFO_KERNEL)); paintLine(xpos+offset, font_info, uname(&uts_info) < 0 ? "n/a" : uts_info.release); #ifdef ENABLE_LUA From 0aac919b949cad5b40542274048ab7a7d6487167 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 3 Mar 2017 23:33:41 +0100 Subject: [PATCH 4/4] imageinfo_ni: small offset corrections and cleanups Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/47b98e5879404b572706c090429d34f21e8d2131 Author: vanhofen Date: 2017-03-03 (Fri, 03 Mar 2017) Origin message was: ------------------ - imageinfo_ni: small offset corrections and cleanups --- src/gui/imageinfo_ni.cpp | 52 ++++++++++++++++++++++------------------ src/gui/imageinfo_ni.h | 2 +- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/src/gui/imageinfo_ni.cpp b/src/gui/imageinfo_ni.cpp index f45f6b19b..018b234fe 100644 --- a/src/gui/imageinfo_ni.cpp +++ b/src/gui/imageinfo_ni.cpp @@ -114,6 +114,10 @@ void CImageInfoNI::Init(void) x = getScreenStartX(width); y = getScreenStartY(height); + // This single correction saves many offsets in code below + x += OFFSET_INNER_MID; + width -= OFFSET_INNER_MID; + systemfs = 0; revision = cs_get_revision(); old_x = 0; @@ -122,9 +126,9 @@ void CImageInfoNI::Init(void) read_old = 0; write_old = 0; net_best = 0; - xcpu = width - width/3 - OFFSET_INNER_MID; + xcpu = x + width - width/3 - OFFSET_INNER_MID; ycpu = y + OFFSET_INNER_MID + (height/3 /* pig-box height */) + (2 * iheight); - max_text_width = xcpu - x - 2*OFFSET_INNER_MID; + max_text_width = xcpu - x - OFFSET_INNER_MID; offset = 0; for (int i = 0; i < info_items_count; i++) { @@ -161,7 +165,7 @@ int CImageInfoNI::exec(CMenuTarget* parent, const std::string &) fader.StartFadeIn(); bool fadeout = false; paint(); - paint_pig(xcpu, y + OFFSET_INNER_MID, width/3, height/3); + paint_pic(xcpu, y + OFFSET_INNER_MID, width/3, height/3); StartInfoThread(); while (1) @@ -239,7 +243,7 @@ void CImageInfoNI::hide() frameBuffer->paintBackground(); } -void CImageInfoNI::paint_pig(int px, int py, int w, int h) +void CImageInfoNI::paint_pic(int px, int py, int w, int h) { frameBuffer->paintBoxRel(px - OFFSET_INNER_MID, py - OFFSET_INNER_MID, w + 2*OFFSET_INNER_MID, h + 2*OFFSET_INNER_MID, COL_INFOBAR_PLUS_0); g_PicViewer->DisplayImage(ICONSDIR "/start.jpg", px, py, w, h, frameBuffer->TM_NONE); @@ -253,22 +257,24 @@ void CImageInfoNI::paintLine(int xpos, int font, std::string text) void CImageInfoNI::clearLine(int xpos, int font) { int font_height = g_Font[font]->getHeight(); - frameBuffer->paintBoxRel(xpos, ypos - font_height, max_text_width , font_height, COL_BLUE/*INFOBAR_PLUS_0*/); + frameBuffer->paintBoxRel(xpos, ypos - font_height, max_text_width, font_height, COL_BLUE/*INFOBAR_PLUS_0*/); } void CImageInfoNI::paint() { - const char * head_string; - int xpos = x + OFFSET_INNER_MID; - + int xpos = x; ypos = y; + const char * head_string; head_string = g_Locale->getText(LOCALE_IMAGEINFO_HEAD); CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, head_string); //background frameBuffer->paintBoxRel(0, 0, max_width, max_height, COL_INFOBAR_PLUS_0); + // just for visual debug + //frameBuffer->paintBoxRel(xpos, ypos, width, height, COL_INFOBAR_PLUS_1); + ypos += hheight; g_Font[font_head]->RenderString(xpos, ypos, max_text_width, head_string, COL_MENUHEAD_TEXT); @@ -336,14 +342,12 @@ void CImageInfoNI::paint() paintLine(xpos+offset, font_info, homepage); ypos += iheight; - ypos += sheight; get_MTD_Info(); //paint_MTD_Info(xpos); - //ypos+= sheight; + //ypos += sheight; paint_DF_Info(xpos); - ypos+= sheight; paint_Stat_Info_Box(xcpu, ycpu, width/3, height/3); @@ -357,8 +361,8 @@ void* CImageInfoNI::InfoProc(void *arg) CImageInfoNI *imageInfo = (CImageInfoNI*) arg; while(1) { - imageInfo->paint_MEM_Info(imageInfo->x + OFFSET_INNER_MID, imageInfo->ypos); - imageInfo->paint_NET_Info(imageInfo->x + OFFSET_INNER_MID, imageInfo->ypos); + imageInfo->paint_MEM_Info(imageInfo->x, imageInfo->ypos); + imageInfo->paint_NET_Info(imageInfo->x, imageInfo->ypos); sleep(1); } return 0; @@ -606,6 +610,8 @@ void CImageInfoNI::get_DF_Info() void CImageInfoNI::paint_DF_Info(int posx) { + ypos += sheight/2; + std::ostringstream buf; int boxH = sheight - 2*OFFSET_INNER_MIN; int boxW = swidth*8; @@ -614,7 +620,7 @@ void CImageInfoNI::paint_DF_Info(int posx) get_DF_Info(); - buf << "Imagesize (" << image_size.percent << " Percent):"; + buf << "Imagesize (" << image_size.percent << "%):"; paintLine(posx, font_small, buf.str()); CProgressBar pb(boxX, boxY, boxW, boxH); @@ -712,10 +718,10 @@ void CImageInfoNI::paint_MEM_Info(int posx, int posy) get_MEM_Info(); int mem_percent = get_MEM_Percent(mem_info.total, mem_info.used); - buf << "Memory (" << mem_percent << " Percent):"; + buf << "Memory (" << mem_percent << "%):"; // progressbar ist in same line - so we not can use max_text_width - frameBuffer->paintBoxRel(posx - OFFSET_INNER_MID, posy - sheight, boxX - posx + OFFSET_INNER_MID, sheight, COL_INFOBAR_PLUS_0); - g_Font[font_small]->RenderString(posx, posy, boxX-posx, buf.str().c_str(), COL_INFOBAR_TEXT); + frameBuffer->paintBoxRel(posx, posy - sheight, boxX - posx, sheight, COL_INFOBAR_PLUS_0); + g_Font[font_small]->RenderString(posx, posy, boxX - posx, buf.str().c_str(), COL_INFOBAR_TEXT); CProgressBar pb(boxX, boxY, boxW, boxH); pb.setFrameThickness(0); @@ -728,7 +734,7 @@ void CImageInfoNI::paint_MEM_Info(int posx, int posy) buf.str(""); buf.precision(2); buf << fixed << "Total: " << (mem_info.total/1024.0) << " MB Used: " << (mem_info.used/1024.0) << " MB"; - frameBuffer->paintBoxRel(posx - OFFSET_INNER_MID, posy - sheight, max_text_width + OFFSET_INNER_MID, sheight, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(posx, posy - sheight, max_text_width, sheight, COL_INFOBAR_PLUS_0); g_Font[font_small]->RenderString(posx, posy, max_text_width, buf.str().c_str(), COL_INFOBAR_TEXT); posy+= sheight; @@ -740,7 +746,7 @@ void CImageInfoNI::paint_MEM_Info(int posx, int posy) << "Cached: " << (mem_info.cached < 1024 ? mem_info.cached : (mem_info.cached/1024.0)) << (mem_info.cached < 1024?" KB":" MB)"); - frameBuffer->paintBoxRel(posx - OFFSET_INNER_MID, posy - sheight, max_text_width + OFFSET_INNER_MID, sheight, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(posx, posy - sheight, max_text_width, sheight, COL_INFOBAR_PLUS_0); g_Font[font_small]->RenderString(posx, posy, max_text_width, buf.str().c_str(), COL_INFOBAR_TEXT); } @@ -869,8 +875,8 @@ void CImageInfoNI::paint_NET_Info(int posx, int posy) sprintf(temp_string,"Interface eth0 (%d%%):",percent); // progressbar ist in same line - so we not can use max_text_width - frameBuffer->paintBoxRel(posx - OFFSET_INNER_MID, posy - sheight, boxX - posx + OFFSET_INNER_MID, sheight, COL_INFOBAR_PLUS_0); - g_Font[font_small]->RenderString(posx, posy, boxX-posx, temp_string, COL_INFOBAR_TEXT); + frameBuffer->paintBoxRel(posx, posy - sheight, boxX - posx, sheight, COL_INFOBAR_PLUS_0); + g_Font[font_small]->RenderString(posx, posy, boxX - posx, temp_string, COL_INFOBAR_TEXT); CProgressBar pb(boxX, boxY, boxW, boxH); pb.setFrameThickness(0); @@ -882,13 +888,13 @@ void CImageInfoNI::paint_NET_Info(int posx, int posy) posy+= sheight; sprintf(temp_string,"Receive: %llu bit/s Transmit: %llu bit/s",(long long unsigned int)rbit_s,(long long unsigned int)wbit_s); - frameBuffer->paintBoxRel(posx - OFFSET_INNER_MID, posy - sheight, max_text_width + OFFSET_INNER_MID, sheight, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(posx, posy - sheight, max_text_width, sheight, COL_INFOBAR_PLUS_0); g_Font[font_small]->RenderString(posx, posy, max_text_width, temp_string, COL_INFOBAR_TEXT); posy+= sheight; sprintf(temp_string,"Maximal: %llu bit/s - %.2f MB/s (%d%%)",(long long unsigned int)net_best,net_best/(8.0*1024.0*1024.0),(int)((net_best*100)/max_bit)); - frameBuffer->paintBoxRel(posx - OFFSET_INNER_MID, posy - sheight, max_text_width + OFFSET_INNER_MID, sheight, COL_INFOBAR_PLUS_0); + frameBuffer->paintBoxRel(posx, posy - sheight, max_text_width, sheight, COL_INFOBAR_PLUS_0); g_Font[font_small]->RenderString(posx, posy, max_text_width, temp_string, COL_INFOBAR_TEXT); last_tv.tv_sec = tv.tv_sec; diff --git a/src/gui/imageinfo_ni.h b/src/gui/imageinfo_ni.h index 2ecd32cca..5a4259bc9 100644 --- a/src/gui/imageinfo_ni.h +++ b/src/gui/imageinfo_ni.h @@ -59,7 +59,7 @@ class CImageInfoNI : public CMenuTarget int font_small; void paint(); - void paint_pig(int x, int y, int w, int h); + void paint_pic(int x, int y, int w, int h); void paintLine(int xpos, int font, std::string text); void clearLine(int xpos, int font);