Commit 6379108a authored by Joachim Eibl's avatar Joachim Eibl

- Fix for calculating tab width (using QFontMetricsF).

- Don't require fixed width fonts in KDE version.
Signed-off-by: default avatarjoachim99 <joachim.eibl@gmx.de>
parent 56c13726
......@@ -794,7 +794,7 @@ public:
void DiffTextWindowData::prepareTextLayout( QTextLayout& textLayout, bool bFirstLine, int visibleTextWidth )
{
QTextOption textOption;
textOption.setTabStop( m_pDiffTextWindow->fontMetrics().width(' ') * m_pOptions->m_tabSize );
textOption.setTabStop( QFontMetricsF(m_pDiffTextWindow->font()).width(' ') * m_pOptions->m_tabSize );
if ( m_pOptions->m_bShowWhiteSpaceCharacters )
textOption.setFlags( QTextOption::ShowTabsAndSpaces );
if ( m_pOptions->m_bRightToLeftLanguage )
......
......@@ -1673,7 +1673,7 @@ QVector<QTextLayout::FormatRange> MergeResultWindow::getTextLayoutForLine(int li
{
// tabs
QTextOption textOption;
textOption.setTabStop( fontMetrics().width(' ') * m_pOptions->m_tabSize );
textOption.setTabStop( QFontMetricsF(font()).width(' ') * m_pOptions->m_tabSize );
if ( m_pOptions->m_bShowWhiteSpaceCharacters )
{
textOption.setFlags( QTextOption::ShowTabsAndSpaces );
......
......@@ -199,8 +199,8 @@ public:
*m_pVar = defaultVal;
m_defaultVal = defaultVal;
}
void setToDefault(){ setFont( m_defaultVal, true /*only fixed*/ ); }
void setToCurrent(){ setFont( *m_pVar, true /*only fixed*/ ); }
void setToDefault(){ setFont( m_defaultVal, false ); }
void setToCurrent(){ setFont( *m_pVar, false ); }
void apply() { *m_pVar = font();}
void write(ValueMap* config){ config->writeEntry(m_saveName, *m_pVar ); }
void read (ValueMap* config){ *m_pVar = config->readFontEntry( m_saveName, m_pVar ); }
......
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