From c95ba0b3d2c9c3a3d29ef0b7a1e94a0633e8b032 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 7 Jan 2016 19:33:41 +0100 Subject: [PATCH] CInfoViewer: try to fix channel number allignment Allignment was broken on different font size. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/11e480b6e88b8e5a675c5b65ffc2b0181f13f831 Author: Thilo Graf Date: 2016-01-07 (Thu, 07 Jan 2016) ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 393590c3c..13cdd9aa8 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -777,10 +777,19 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap if ((!logo_ok && g_settings.infobar_show_channellogo < 2) || g_settings.infobar_show_channellogo == 2 || g_settings.infobar_show_channellogo == 4) // no logo in numberbox { // show number in numberbox - int tmpwidth = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getRenderWidth(strChanNum); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->RenderString( - BoxStartX + (ChanWidth - tmpwidth) / 2, ChanNumYPos, - ChanWidth, strChanNum, col_NumBoxText); + int h_tmp = numbox->getHeight(); + int y_tmp = numbox->getYPos() + 5*100/h_tmp; //5% + if (g_settings.infobar_sat_display){ + int h_sfont = g_SignalFont->getHeight(); + h_tmp -= h_sfont; + y_tmp += h_sfont; + } + y_tmp += h_tmp/2 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getHeight()/2; + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->RenderString(BoxStartX + (ChanWidth-g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]->getRenderWidth(strChanNum))/2, + y_tmp, + ChanWidth, + strChanNum, + col_NumBoxText); } if (ChannelLogoMode == 1 || ( g_settings.infobar_show_channellogo == 3 && !logo_ok) || g_settings.infobar_show_channellogo == 6 ) /* channel number besides channel name */ {