From 1c286a20ad28f829875874e4f9ebb9a64602e1b9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 24 Jan 2017 22:14:15 +0100 Subject: [PATCH] CEventList: fix current channel position and ensure clean up header Current channel name was out of center and a clean up of header background was required because texts are only painted with transparent background and old texts are futher visible. Now we have a clean background before repaint logo or new channel names. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/17a84f0e75d315d4acc81e815e1fd9efe484354f Author: Thilo Graf Date: 2017-01-24 (Tue, 24 Jan 2017) ------------------ This commit was generated by Migit --- src/gui/eventlist.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 741ec77fd..76c771559 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -877,7 +877,9 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s } else { header->removeCCItem(midLogo); //remove/destroy logo object, if it is not available - CComponentsText *midText = new CComponentsText(CC_CENTERED, CC_CENTERED, mid_width, theight, _channelname, CTextBox::CENTER, g_Font[font_mid], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + int w_midText = g_Font[font_mid]->getRenderWidth(_channelname); + CComponentsText *midText = new CComponentsText(0, CC_CENTERED, w_midText, theight, _channelname, CTextBox::CENTER, g_Font[font_mid], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + midText->setXPos(full_width/2 - midText->getWidth()/2); midText->doPaintBg(false); } @@ -892,6 +894,8 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s rText->doPaintBg(false); } + if (header->isPainted()) //clean up background of header for new captions + header->kill(header->getColorBody()); header->paint(CC_SAVE_SCREEN_NO); }