CDBoxInfoWidget: remove superfluous paint of header

Origin commit data
------------------
Commit: d8e3ecfa1d
Author: Thilo Graf <dbt@novatux.de>
Date: 2016-03-22 (Tue, 22 Mar 2016)
This commit is contained in:
2016-03-22 11:35:02 +01:00
parent 363d521343
commit 694fea40ad
2 changed files with 16 additions and 5 deletions

View File

@@ -39,7 +39,7 @@
#include <libgen.h>
#include <gui/dboxinfo.h>
#include <gui/components/cc.h>
#include <global.h>
#include <neutrino.h>
@@ -74,7 +74,7 @@ CDBoxInfoWidget::CDBoxInfoWidget()
height = 0;
x = 0;
y = 0;
header = NULL;
fontWidth = fm->getWidth();
sizeWidth = 6 * fm->getMaxDigitWidth()
+ fm->getRenderWidth(std::string(" MiB") + g_Locale->getText(LOCALE_UNIT_DECIMAL)); ;//9999.99 MiB
@@ -83,6 +83,12 @@ CDBoxInfoWidget::CDBoxInfoWidget()
nameWidth = fontWidth * 17;
}
CDBoxInfoWidget::~CDBoxInfoWidget()
{
delete header;
header = NULL;
}
int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &)
{
if (parent)
@@ -166,6 +172,7 @@ int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &)
void CDBoxInfoWidget::hide()
{
header->kill();
frameBuffer->paintBackgroundBoxRel(x,y, width,height);
frameBuffer->blit();
}
@@ -360,8 +367,10 @@ void CDBoxInfoWidget::paint()
width = max(width, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(title, true) + 50);
x = getScreenStartX(width);
CComponentsHeader header(x, ypos, width, hheight, title, NEUTRINO_ICON_SHELL);
header.paint(CC_SAVE_SCREEN_NO);
if (!header)
header = new CComponentsHeader(x, ypos, width, hheight, title, NEUTRINO_ICON_SHELL);
if (!header->isPainted())
header->paint(CC_SAVE_SCREEN_NO);
//paint body
frameBuffer->paintBoxRel(x, ypos+ hheight, width, height- hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);