Fixes for non-standart icon sizes. Not complete yet, work in progress. Probably will broke commit #568

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@569 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Commit: 56674d5561
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2010-05-06 (Thu, 06 May 2010)
This commit is contained in:
[CST] Focus
2010-05-06 09:39:29 +00:00
parent 650b44c1a1
commit c6ca418526
38 changed files with 678 additions and 354 deletions

View File

@@ -134,6 +134,12 @@ void CStringInput::init()
width = neededWidth+20;
hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
if (!(iconfile.empty()))
{
int icol_w, icol_h;
frameBuffer->getIconSize(iconfile.c_str(), &icol_w, &icol_h);
hheight = std::max(hheight, icol_h+4);
}
mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
iheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight();
@@ -474,16 +480,16 @@ const char * CStringInput::getHint1(void)
void CStringInput::paint()
{
int iconoffset;
int icol_w, icol_h;
//frameBuffer->paintBoxRel(x, y, width, hheight, COL_MENUHEAD_PLUS_0);
//frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0);
frameBuffer->paintBoxRel(x, y, width, hheight, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_TOP); //round
frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);//round
if (!(iconfile.empty()))
{
frameBuffer->paintIcon(iconfile, x + 8, y + 5);
iconoffset = 28;
frameBuffer->getIconSize(iconfile.c_str(), &icol_w, &icol_h);
frameBuffer->paintIcon(iconfile, x + 8, y, hheight);
iconoffset = icol_w + 10;
}
else
iconoffset = 0;
@@ -580,7 +586,6 @@ void CStringInputSMS::initSMS(const char * const Valid_Chars)
y = ((500-height)>>1);
}
void CStringInputSMS::NormalKeyPressed(const neutrino_msg_t key)
{
if (CRCInput::isNumeric(key))
@@ -687,14 +692,23 @@ const struct button_label CStringInputSMSButtons[2] =
void CStringInputSMS::paint()
{
int icol_w, icol_h;
int bh, bw, fh;
CStringInput::paint();
fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight();
frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h);
bh = std::max(fh, icol_h+4);
bw = (width - 20) / 2;
frameBuffer->paintIcon(NEUTRINO_ICON_NUMERIC_PAD, x+20+140, y+ hheight+ mheight+ iheight* 3+ 30, 0, COL_MENUCONTENT);
frameBuffer->paintBoxRel(x,y+height-25, width,25, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);
frameBuffer->paintHLine(x, x+width, y+height-25, COL_INFOBAR_SHADOW_PLUS_0);
frameBuffer->paintBoxRel(x, y+height-bh, width, bh, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM);
//frameBuffer->paintHLine(x, x+width, y+height-25, COL_INFOBAR_SHADOW_PLUS_0);
::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 8, y+height-25+1, 230, 2, CStringInputSMSButtons);
//::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 8, y+height-25+1, 230, 2, CStringInputSMSButtons);
::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y+height-bh, bw, bh, 2, CStringInputSMSButtons);
}
void CPINInput::paintChar(int pos)