neutrino: resize keychooser window with font size

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@307 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
seife
2010-02-08 20:47:33 +00:00
parent 629c91063f
commit d6180e4ab2

View File

@@ -153,7 +153,16 @@ void CKeyChooserItem::paint()
CFrameBuffer * frameBuffer = CFrameBuffer::getInstance(); CFrameBuffer * frameBuffer = CFrameBuffer::getInstance();
width = w_max(350, 0); int tmp;
width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(g_Locale->getText(name), true);
tmp = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_KEYCHOOSER_TEXT1), true);
if (tmp > width)
width = tmp;
tmp = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(g_Locale->getText(LOCALE_KEYCHOOSER_TEXT2), true);
if (tmp > width)
width = tmp;
width += 20;
width = w_max(width, 0);
height = h_max(hheight + 2 * mheight, 0); height = h_max(hheight + 2 * mheight, 0);
x = frameBuffer->getScreenX() + ((frameBuffer->getScreenWidth()-width) >> 1); x = frameBuffer->getScreenX() + ((frameBuffer->getScreenWidth()-width) >> 1);
y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight()-height) >> 1); y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight()-height) >> 1);