From feae6b8bbdf28cf259f3a34c9a7fb86885bbe614 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 16 Jul 2012 13:47:35 +0400 Subject: [PATCH] gui/widget/stringinput_ext.cpp: fix size with hints, fix screen position Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/96cb49b4feb64a56d024c3e0a0cc735def00c868 Author: [CST] Focus Date: 2012-07-16 (Mon, 16 Jul 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/stringinput_ext.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index ffb5e9ccd..2f80729bc 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -116,13 +116,21 @@ void CExtendedInput::calculateDialog() hintPosY = height -10; - if (hint_1 != NONEXISTANT_LOCALE) + if (hint_1 != NONEXISTANT_LOCALE) { height += iheight; - if (hint_2 != NONEXISTANT_LOCALE) + int hw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getRenderWidth(g_Locale->getText(hint_1), true); + if(width < hw + 40) + width = hw + 40; + } + if (hint_2 != NONEXISTANT_LOCALE) { height += iheight; + int hw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getRenderWidth(g_Locale->getText(hint_2), true); + if(width < hw) + width = hw; + } - x = ((frameBuffer->getScreenWidth() - width)>>1); - y = ((frameBuffer->getScreenHeight() - height)>>1); + x = frameBuffer->getScreenX() + ((frameBuffer->getScreenWidth() - width)>>1); + y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight() - height)>>1); hintPosY += y; }