From ff81d85282041f7d72bfb87d74391dd3cbff54a5 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 14 Jul 2010 08:04:45 +0000 Subject: [PATCH] fix center txt git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@664 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1593513c1fac8a06fd4b2ba01936e8dd253ff098 Author: Jacek Jendrzej Date: 2010-07-14 (Wed, 14 Jul 2010) Origin message was: ------------------ -fix center txt git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@664 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/widget/buttons.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/buttons.cpp b/src/gui/widget/buttons.cpp index b7abf9b57..73f15004f 100644 --- a/src/gui/widget/buttons.cpp +++ b/src/gui/widget/buttons.cpp @@ -31,8 +31,12 @@ void paintButtons(CFrameBuffer * const frameBuffer, Font * const font, const CLo { for (unsigned int i = 0; i < count; i++) { + int iw = 0, ih = 0; + int fh = font->getHeight(); + + frameBuffer->getIconSize(content[i].button, &iw, &ih); frameBuffer->paintIcon(content[i].button, x + i * buttonwidth, y); - font->RenderString(x + i * buttonwidth + 20, y + 19, buttonwidth - 20, localemanager->getText(content[i].locale), COL_INFOBAR, 0, true); // UTF-8 + font->RenderString(x + i * buttonwidth + 20, y + fh-(fh-ih)/2, buttonwidth - 20, localemanager->getText(content[i].locale), COL_INFOBAR, 0, true); // UTF-8 } } #endif