forked from qt-creator/qt-creator
Editor: do not set the viewport margins if they have not changed
Change-Id: I01adabc52e47e8a47aff0f5dc2b580066e51307c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -5168,10 +5168,13 @@ void TextEditorWidgetPrivate::slotUpdateExtraAreaWidth(std::optional<int> width)
|
|||||||
{
|
{
|
||||||
if (!width.has_value())
|
if (!width.has_value())
|
||||||
width = q->extraAreaWidth();
|
width = q->extraAreaWidth();
|
||||||
|
QMargins margins;
|
||||||
if (q->isLeftToRight())
|
if (q->isLeftToRight())
|
||||||
q->setViewportMargins(*width, 0, 0, 0);
|
margins = QMargins(*width, 0, 0, 0);
|
||||||
else
|
else
|
||||||
q->setViewportMargins(0, 0, *width, 0);
|
margins = QMargins(0, 0, *width, 0);
|
||||||
|
if (margins != q->viewportMargins())
|
||||||
|
q->setViewportMargins(margins);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Internal::ExtraAreaPaintEventData
|
struct Internal::ExtraAreaPaintEventData
|
||||||
|
Reference in New Issue
Block a user