stringinput: save/restore screen and add shadow

Origin commit data
------------------
Commit: d69502e5b8
Author: vanhofen <vanhofen@gmx.de>
Date: 2013-05-14 (Tue, 14 May 2013)

Origin message was:
------------------
- stringinput: save/restore screen and add shadow
This commit is contained in:
vanhofen
2013-05-14 01:07:58 +02:00
parent 25de7b0fff
commit 056e83e6fc

View File

@@ -389,6 +389,11 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & )
strcat(value, " ");
strncpy(oldval, value, size);
fb_pixel_t * pixbuf = new fb_pixel_t[(width + SHADOW_OFFSET) * (hheight + bheight + SHADOW_OFFSET)];
if (pixbuf != NULL)
frameBuffer->SaveScreen(x, y, width + SHADOW_OFFSET, hheight + bheight + SHADOW_OFFSET, pixbuf);
paint();
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]);
@@ -500,6 +505,12 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & )
hide();
if (pixbuf != NULL)
{
frameBuffer->RestoreScreen(x, y, width + SHADOW_OFFSET, hheight + bheight + SHADOW_OFFSET, pixbuf);
delete[] pixbuf;//Mismatching allocation and deallocation: pixbuf
}
for(int count=size-1;count>=0;count--)
{
if((value[count]==' ') || (value[count]==0))
@@ -532,11 +543,12 @@ int CStringInput::handleOthers(const neutrino_msg_t /*msg*/, const neutrino_msg_
void CStringInput::hide()
{
frameBuffer->paintBackgroundBoxRel(x, y, width, height);
frameBuffer->paintBackgroundBoxRel(x, y, width + SHADOW_OFFSET, height + SHADOW_OFFSET);
}
void CStringInput::paint(bool sms)
{
frameBuffer->paintBoxRel(x + SHADOW_OFFSET, y + SHADOW_OFFSET, width, hheight + bheight, COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE, CORNER_ALL); //round
frameBuffer->paintBoxRel(x, y, width, hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); //round
frameBuffer->paintBoxRel(x, y + hheight, width, bheight, COL_MENUCONTENT_PLUS_0, sms ? 0 : RADIUS_LARGE, CORNER_BOTTOM);