Re-introduction of the feature to adjust the line spacing

This already has been implemented in change
dc64f3207b, but was reverted with
change f220cb0e23) because this does not
work with text wrapping rendering, due to internal limitations of Qt.
Since this is a highly requested feature (e.g. QTCREATORBUG-13727), but
an internal change within Qt is not in sight, the approach taken here
is to offer the text wrapping feature in the settings only when the
line spacing is set to 100%. Additionally, a change has been made to
the layout of the display settings page to reflect this.

Fixes: QTCREATORBUG-13727
Change-Id: Ib233cf90a5f336bc591fa1bf860e162fa774dfe3
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Florian Koch
2022-08-28 19:32:07 +02:00
parent 0f2ade49f9
commit 69fad91660
8 changed files with 246 additions and 37 deletions

View File

@@ -306,7 +306,7 @@ private:
{
QTextCursor tc = m_editor->textCursor();
m_currentPos = tc.position();
m_lineSpacing = m_editor->cursorRect(tc).height();
m_lineSpacing = m_editor->document()->documentLayout()->blockBoundingRect(tc.block()).height();
setFont(m_editor->extraArea()->font());
// Follow geometry of normal line numbers if visible,