New option for disabling of tinting the right margin area in text editor

Since version 4.14 the right margin of the text editor is tinted. The
fill color corresponds to a darkened editor background color (for light
UI themes), or a lightened background color (for dark themes). However,
the default for most other editors and IDEs is just a single  vertical
line, as was the case in Qt Creator up until version 4.13. The different
colored area may be considered uncommon and irritating by some users.
Therefore, the new checkbox "Tint whole margin area" has been added under the
"Text Editor/Display/Text Wrapping" section in the settings for switching
between <= 4.13 and 4.14+ behavior.

Change-Id: I6761943477738a4c78b97a5f70a19f1ff8a428e5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Florian Koch
2022-08-15 23:07:21 +02:00
parent 038b839f9e
commit 4740430577
8 changed files with 34 additions and 2 deletions

View File

@@ -4071,7 +4071,7 @@ void TextEditorWidgetPrivate::paintRightMarginArea(PaintEventData &data, QPainte
data.rightMargin = QFontMetricsF(q->font()).horizontalAdvance(QLatin1Char('x'))
* m_visibleWrapColumn
+ data.offset.x() + 4;
if (data.rightMargin < data.viewportRect.width()) {
if (m_marginSettings.m_tintMarginArea && data.rightMargin < data.viewportRect.width()) {
const QRectF behindMargin(data.rightMargin,
data.eventRect.top(),
data.viewportRect.width() - data.rightMargin,