mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CTextBox: add attribut 'm_bg_painted'
Shoul help in together with changed text content to control required text render.
This commit is contained in:
@@ -159,6 +159,7 @@ void CTextBox::initVar(void)
|
|||||||
m_pcFontText = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1];
|
m_pcFontText = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1];
|
||||||
m_nFontTextHeight = getFontTextHeight();
|
m_nFontTextHeight = getFontTextHeight();
|
||||||
m_nMaxTextWidth = 0;
|
m_nMaxTextWidth = 0;
|
||||||
|
m_bg_painted = false;
|
||||||
|
|
||||||
m_nNrOfPages = 1;
|
m_nNrOfPages = 1;
|
||||||
m_nNrOfLines = 0;
|
m_nNrOfLines = 0;
|
||||||
@@ -648,6 +649,7 @@ void CTextBox::refreshText(void)
|
|||||||
//TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__);
|
//TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__);
|
||||||
//paint full background only on new text, otherwise paint required background
|
//paint full background only on new text, otherwise paint required background
|
||||||
frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, BgRadiusType);
|
frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, BgRadiusType);
|
||||||
|
m_bg_painted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -716,6 +718,7 @@ void CTextBox::refreshText(void)
|
|||||||
frameBuffer->paintBoxRel(tx, ty-th, tw, th, COL_RED, m_nBgRadius, m_nBgRadiusType);
|
frameBuffer->paintBoxRel(tx, ty-th, tw, th, COL_RED, m_nBgRadius, m_nBgRadiusType);
|
||||||
#endif
|
#endif
|
||||||
//TRACE("[CTextBox] %s Line %d m_cFrame.iX %d m_cFrameTextRel.iX %d\r\n", __FUNCTION__, __LINE__, m_cFrame.iX, m_cFrameTextRel.iX);
|
//TRACE("[CTextBox] %s Line %d m_cFrame.iX %d m_cFrameTextRel.iX %d\r\n", __FUNCTION__, __LINE__, m_cFrame.iX, m_cFrameTextRel.iX);
|
||||||
|
if (m_bg_painted || m_old_cText != m_cText)
|
||||||
m_pcFontText->RenderString(tx, ty, tw, m_cLineArray[i].c_str(), m_textColor, 0, m_renderMode | ((m_utf8_encoded) ? Font::IS_UTF8 : 0));
|
m_pcFontText->RenderString(tx, ty, tw, m_cLineArray[i].c_str(), m_textColor, 0, m_renderMode | ((m_utf8_encoded) ? Font::IS_UTF8 : 0));
|
||||||
m_old_cText = m_cText;
|
m_old_cText = m_cText;
|
||||||
y += m_nFontTextHeight;
|
y += m_nFontTextHeight;
|
||||||
|
@@ -122,6 +122,7 @@ class CTextBox : public sigc::trackable
|
|||||||
fb_pixel_t m_old_textBackgroundColor, m_old_textColor;
|
fb_pixel_t m_old_textBackgroundColor, m_old_textColor;
|
||||||
|
|
||||||
bool m_showTextFrame;
|
bool m_showTextFrame;
|
||||||
|
bool m_bg_painted;
|
||||||
|
|
||||||
CBox m_cFrame;
|
CBox m_cFrame;
|
||||||
CBox m_cFrameTextRel;
|
CBox m_cFrameTextRel;
|
||||||
|
Reference in New Issue
Block a user