From 2cefa91372e1600d47e23d4a34438c3879be66a4 Mon Sep 17 00:00:00 2001 From: seife Date: Wed, 6 Apr 2011 17:56:08 +0000 Subject: [PATCH] stringinput: fix rounded corners for SMS stringinput The SMS stringinput method has a button bar below the input field, so the rounded corners are on the button bar instead of the input field. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1377 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/widget/stringinput.cpp | 15 +++++++++++---- src/gui/widget/stringinput.h | 4 ++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index 1056de39f..bceccca9b 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -532,13 +532,20 @@ const char * CStringInput::getHint1(void) return g_Locale->getText(hint_1); } -void CStringInput::paint() +void CStringInput::paint(bool buttons) { int iconoffset; int icol_w, icol_h; + int radius; + + /* if there's a button bar below the stringinput (SMS), no rounded corners */ + if (buttons) + radius = 0; + else + radius = RADIUS_LARGE; 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); + frameBuffer->paintBoxRel(x, y + hheight, width, height - hheight, COL_MENUCONTENT_PLUS_0, radius, CORNER_BOTTOM); if (!(iconfile.empty())) { @@ -743,9 +750,9 @@ const struct button_label CStringInputSMSButtons[2] = { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_STRINGINPUT_CLEAR } }; -void CStringInputSMS::paint() +void CStringInputSMS::paint(bool /*unused*/) { - CStringInput::paint(); + CStringInput::paint(true); frameBuffer->paintIcon(NEUTRINO_ICON_NUMERIC_PAD, x+20+140, y+ hheight+ mheight+ iheight* 3+ 30, 0, COL_MENUCONTENT); diff --git a/src/gui/widget/stringinput.h b/src/gui/widget/stringinput.h index f5b139c9b..0da2a07f2 100644 --- a/src/gui/widget/stringinput.h +++ b/src/gui/widget/stringinput.h @@ -70,7 +70,7 @@ class CStringInput : public CMenuTarget virtual void init(); virtual const char * getHint1(void); - virtual void paint(); + virtual void paint(bool buttons = false); virtual void paintChar(int pos, char c); virtual void paintChar(int pos); @@ -121,7 +121,7 @@ class CStringInputSMS : public CStringInput virtual void keyLeftPressed(); virtual void keyRightPressed(); - virtual void paint(); + virtual void paint(bool dummy = false); void initSMS(const char * const Valid_Chars); public: