Commit 483d1184 authored by Joachim Eibl's avatar Joachim Eibl

Fix for word wrap.

Signed-off-by: default avatarjoachim99 <joachim.eibl@gmx.de>
parent de8f67d9
Version 0.9.98a - 2012-09-11
============================
- Text rendering now with QTextLayout fixes the following issues
- Correct handling for variable width fonts.
- Corrected display of highlighted text with Qt4.8.x on Ubuntu and Mac.
- Improved handling of texts with both right to left and left to right languages (mixed Arabic and western texts).
- Improved handling of Chinese and Japanese.
Version 0.9.97 - 2012-08-10 Version 0.9.97 - 2012-08-10
=========================== ===========================
- Memory usage optimized for comparison of large directories. (ca. 1/5 needed) - Memory usage optimized for comparison of large directories. (ca. 1/5 needed)
......
...@@ -799,6 +799,9 @@ void DiffTextWindowData::prepareTextLayout( QTextLayout& textLayout, bool bFirst ...@@ -799,6 +799,9 @@ void DiffTextWindowData::prepareTextLayout( QTextLayout& textLayout, bool bFirst
textOption.setFlags( QTextOption::ShowTabsAndSpaces ); textOption.setFlags( QTextOption::ShowTabsAndSpaces );
if ( m_pOptions->m_bRightToLeftLanguage ) if ( m_pOptions->m_bRightToLeftLanguage )
textOption.setAlignment(Qt::AlignRight); // only relevant for multi line text layout textOption.setAlignment(Qt::AlignRight); // only relevant for multi line text layout
if ( visibleTextWidth>=0 )
textOption.setWrapMode( QTextOption::WrapAtWordBoundaryOrAnywhere );
textLayout.setTextOption( textOption ); textLayout.setTextOption( textOption );
if ( m_pOptions->m_bShowWhiteSpaceCharacters ) if ( m_pOptions->m_bShowWhiteSpaceCharacters )
......
...@@ -550,6 +550,7 @@ int MergeResultWindow::getMaxTextWidth() ...@@ -550,6 +550,7 @@ int MergeResultWindow::getMaxTextWidth()
} }
} }
} }
m_maxTextWidth += 5; // cursorwidth
} }
return m_maxTextWidth; return m_maxTextWidth;
} }
...@@ -2525,11 +2526,11 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e ) ...@@ -2525,11 +2526,11 @@ void MergeResultWindow::keyPressEvent( QKeyEvent* e )
m_cursorXPos = newCursorX; m_cursorXPos = newCursorX;
// TODO if width of current line exceeds the current maximum width then force recalculating the scrollbars // TODO if width of current line exceeds the current maximum width then force recalculating the scrollbars
// if ( m_cursorXPos>m_nofColumns ) if ( textLayout.maximumWidth()>getMaxTextWidth() )
// { {
// m_nofColumns = m_cursorXPos; m_maxTextWidth = textLayout.maximumWidth();
// emit resizeSignal(); emit resizeSignal();
// } }
if ( ! bYMoveKey ) if ( ! bYMoveKey )
m_cursorOldXPixelPos = m_cursorXPixelPos; m_cursorOldXPixelPos = m_cursorXPixelPos;
...@@ -2805,8 +2806,6 @@ void MergeResultWindow::resetSelection() ...@@ -2805,8 +2806,6 @@ void MergeResultWindow::resetSelection()
void MergeResultWindow::setModified(bool bModified) void MergeResultWindow::setModified(bool bModified)
{ {
if ( bModified )
m_maxTextWidth = -1;
if (bModified != m_bModified) if (bModified != m_bModified)
{ {
m_bModified = bModified; m_bModified = bModified;
......
#undef VERSION #undef VERSION
#define VERSION "0.9.97" #define VERSION "0.9.98a"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment