From 3079faeedd8d232cf2f4c545a19898a3c2c01d26 Mon Sep 17 00:00:00 2001 From: "techdragon.nguyen@gmail.com" Date: Fri, 27 Jan 2012 21:53:34 +0000 Subject: [PATCH] smoothed out the corners and adjusted coloring of the button generated text buttons for touch devices --- projects/mtg/src/InteractiveButton.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/mtg/src/InteractiveButton.cpp b/projects/mtg/src/InteractiveButton.cpp index 734c7f948..5f3213a15 100644 --- a/projects/mtg/src/InteractiveButton.cpp +++ b/projects/mtg/src/InteractiveButton.cpp @@ -66,7 +66,7 @@ void InteractiveButton::Render() WFont *mainFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT); const string detailedInfoString = _(getText()); float stringWidth = mainFont->GetStringWidth(detailedInfoString.c_str()); - DWORD currentColor = mainFont->GetColor(); + #ifndef TOUCH_ENABLED mXOffset = -5; mYOffset = 10; @@ -81,16 +81,16 @@ void InteractiveButton::Render() { mYOffset = -3; mXOffset = 0; - renderer->FillRoundRect( boxStartX, getY() - 5, stringWidth + 6, mainFont->GetHeight(), .5, ARGB(255, 192, 172, 119)); + renderer->FillRoundRect( boxStartX, getY() - 5, stringWidth , mainFont->GetHeight(), .5, ARGB(255, 192, 172, 119)); renderer->DrawRoundRect( boxStartX, getY() - 5, stringWidth + 6, mainFont->GetHeight(), .75, ARGB(255,255,255,255)); } #else mXOffset = 0; mYOffset = 0; - renderer->FillRoundRect(getX() - 5, getY(), stringWidth + 6, mainFont->GetHeight(), .5, ARGB(255, 192, 172, 119)); - renderer->DrawRoundRect(getX() - 5, getY(), stringWidth + 6, mainFont->GetHeight(), .75, ARGB(255,255,255,255)); + renderer->FillRoundRect(getX() - 5, getY(), stringWidth - 3, mainFont->GetHeight() - 9, 5, ARGB(255, 192, 172, 119)); + renderer->DrawRoundRect(getX() - 5, getY(), stringWidth - 3, mainFont->GetHeight() - 9, 5, ARGB(255,255,255,255)); #endif - mainFont->SetColor(currentColor); + mainFont->SetColor( ARGB(255, 200, 200, 200) ); mainFont->DrawString(detailedInfoString, getX() - mXOffset, getY() + mYOffset); }