From 35eb781667d2b59a104a0fab6562a0517fcee26e Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 8 Feb 2010 20:47:33 +0000 Subject: [PATCH] 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 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d6180e4ab288da38c2fca6f09a799a2489be3427 Author: Stefan Seyfried Date: 2010-02-08 (Mon, 08 Feb 2010) --- src/gui/widget/keychooser.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/keychooser.cpp b/src/gui/widget/keychooser.cpp index 6c5bb9a6e..b1ef8f11b 100644 --- a/src/gui/widget/keychooser.cpp +++ b/src/gui/widget/keychooser.cpp @@ -153,7 +153,16 @@ void CKeyChooserItem::paint() 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); x = frameBuffer->getScreenX() + ((frameBuffer->getScreenWidth()-width) >> 1); y = frameBuffer->getScreenY() + ((frameBuffer->getScreenHeight()-height) >> 1);