CDBoxInfoWidget: remove superfluous paint of header

This commit is contained in:
2016-03-22 11:35:02 +01:00
parent 65f4b82f62
commit d8e3ecfa1d
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);

View File

@@ -36,6 +36,7 @@
#include <gui/widget/menue.h>
#include <driver/framebuffer.h>
#include <driver/fontrenderer.h>
#include <gui/components/cc.h>
#include <string>
class CDBoxInfoWidget : public CMenuTarget
@@ -54,12 +55,13 @@ class CDBoxInfoWidget : public CMenuTarget
int nameWidth;
void paint();
CComponentsHeader *header;
Font *fm, *ft;
public:
CDBoxInfoWidget();
~CDBoxInfoWidget();
void hide();
int exec(CMenuTarget* parent, const std::string & actionKey);