diff options
author | Florian Koch <devfk@outlook.com> | 2022-08-28 19:32:07 +0200 |
---|---|---|
committer | Florian Koch <devfk@outlook.com> | 2022-09-12 16:40:15 +0000 |
commit | 69fad91660ea52b30daffa7e9507163134edf68b (patch) | |
tree | 53061d652550ed9a62bef62fe3d86fb9992da3d3 /src/plugins/texteditor/fontsettings.h | |
parent | 0f2ade49f9819ee8ca63c5ee75bb66560e5760cc (diff) |
Re-introduction of the feature to adjust the line spacing
This already has been implemented in change
dc64f3207bdf6c0d295859e47791cb8193e67f4e, but was reverted with
change f220cb0e23729ddccf52c25dae4e4696641bc62d) 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>
Diffstat (limited to 'src/plugins/texteditor/fontsettings.h')
-rw-r--r-- | src/plugins/texteditor/fontsettings.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/texteditor/fontsettings.h b/src/plugins/texteditor/fontsettings.h index b05ad57871..bb9b324a2c 100644 --- a/src/plugins/texteditor/fontsettings.h +++ b/src/plugins/texteditor/fontsettings.h @@ -53,6 +53,10 @@ public: int fontZoom() const; void setFontZoom(int zoom); + qreal lineSpacing() const; + int relativeLineSpacing() const; + void setRelativeLineSpacing(int relativeLineSpacing); + QFont font() const; bool antialias() const; @@ -81,16 +85,19 @@ public: private: void addMixinStyle(QTextCharFormat &textCharFormat, const MixinTextStyles &mixinStyles) const; + void clearCaches(); private: QString m_family; QString m_schemeFileName; int m_fontSize; int m_fontZoom; + int m_lineSpacing; bool m_antialias; ColorScheme m_scheme; mutable QHash<TextStyle, QTextCharFormat> m_formatCache; mutable QHash<TextStyles, QTextCharFormat> m_textCharFormatCache; + mutable qreal m_lineSpacingCache; }; } // namespace TextEditor |