mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CTextBox: set the correct H/V border
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -251,7 +251,6 @@ void CTextBox::reSizeMainFrameWidth(int textWidth)
|
|||||||
if( iNewWindowWidth < m_nMinWidth)
|
if( iNewWindowWidth < m_nMinWidth)
|
||||||
iNewWindowWidth = m_nMinWidth;
|
iNewWindowWidth = m_nMinWidth;
|
||||||
|
|
||||||
|
|
||||||
m_cFrame.iWidth = iNewWindowWidth;
|
m_cFrame.iWidth = iNewWindowWidth;
|
||||||
|
|
||||||
/* Re-Init the children frames due to new main window */
|
/* Re-Init the children frames due to new main window */
|
||||||
@@ -519,32 +518,30 @@ void CTextBox::refreshText(void)
|
|||||||
if( m_nNrOfLines <= 0)
|
if( m_nNrOfLines <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
int y = m_cFrameTextRel.iY;
|
||||||
int y = m_cFrameTextRel.iY + text_Vborder_width;
|
|
||||||
int i;
|
int i;
|
||||||
int x_center = 0;
|
int x_center = 0;
|
||||||
|
|
||||||
// set text y position
|
// set text y position
|
||||||
if (m_nMode & TOP)
|
if (m_nMode & TOP)
|
||||||
// move to top of frame
|
// move to top of frame
|
||||||
y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * m_nLinesPerPage) >> 1) - text_Vborder_width;
|
y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * m_nLinesPerPage) >> 1);
|
||||||
else if (m_nMode & BOTTOM)
|
else if (m_nMode & BOTTOM)
|
||||||
// move to bottom of frame
|
// move to bottom of frame
|
||||||
y += m_cFrameTextRel.iHeight - text_Vborder_width - (m_nNrOfLines > 1 ? (m_nNrOfLines-1)*m_nFontTextHeight : 0) ;
|
y += m_cFrameTextRel.iHeight - (m_nNrOfLines > 1 ? (m_nNrOfLines-1)*m_nFontTextHeight : 0) - text_Vborder_width;
|
||||||
//m_nFontTextHeight + text_Vborder_width /*- ((m_cFrameTextRel.iHeight + m_nFontTextHeight*/ * m_nLinesPerPage/*) >> 1)*/;
|
//m_nFontTextHeight + text_Vborder_width /*- ((m_cFrameTextRel.iHeight + m_nFontTextHeight*/ * m_nLinesPerPage/*) >> 1)*/;
|
||||||
else
|
else
|
||||||
// fit into mid of frame space
|
// fit into mid of frame space
|
||||||
y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * std::min(m_nLinesPerPage, m_nNrOfLines)) >> 1) - text_Vborder_width;
|
y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * std::min(m_nLinesPerPage, m_nNrOfLines)) >> 1);
|
||||||
|
|
||||||
for(i = m_nCurrentLine; i < m_nNrOfLines && i < m_nCurrentLine + m_nLinesPerPage; i++)
|
for(i = m_nCurrentLine; i < m_nNrOfLines && i < m_nCurrentLine + m_nLinesPerPage; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
//calculate centered xpos
|
//calculate centered xpos
|
||||||
if( m_nMode & CENTER ){
|
if( m_nMode & CENTER ){
|
||||||
x_center = (m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i], true))>>1;
|
x_center = ((m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i], true))>>1) - text_Hborder_width;
|
||||||
}
|
}
|
||||||
else if ( m_nMode & RIGHT ){
|
else if ( m_nMode & RIGHT ){
|
||||||
x_center = (m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i], true));
|
x_center = ((m_cFrameTextRel.iWidth - m_pcFontText->getRenderWidth(m_cLineArray[i], true)) - text_Hborder_width*2);
|
||||||
if ( m_nMode & SCROLL )
|
if ( m_nMode & SCROLL )
|
||||||
x_center -= SCROLL_FRAME_WIDTH;
|
x_center -= SCROLL_FRAME_WIDTH;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user