forked from qt-creator/qt-creator
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user