Merge remote-tracking branch 'origin/10.0' into qds/dev

Change-Id: I51801c3bec7e29f7c7384d86d79b4fcabb4f99c1
This commit is contained in:
Tim Jenßen
2023-04-27 20:26:12 +02:00
46 changed files with 814 additions and 149 deletions

View File

@@ -108,6 +108,9 @@ void CodeStyleEditor::finish()
{
if (m_widget)
m_widget->finish();
if (m_additionalGlobalSettingsWidget)
m_additionalGlobalSettingsWidget->finish();
}
} // TextEditor

View File

@@ -2913,9 +2913,9 @@ void TextEditorWidget::insertCodeSnippet(const QTextCursor &cursor_arg,
d->m_document->autoIndent(cursor);
cursor.endEditBlock();
const QColor &occurrencesColor
const QColor occurrencesColor
= textDocument()->fontSettings().toTextCharFormat(C_OCCURRENCES).background().color();
const QColor &renameColor
const QColor renameColor
= textDocument()->fontSettings().toTextCharFormat(C_OCCURRENCES_RENAME).background().color();
for (const CursorPart &part : cursorParts) {

View File

@@ -134,8 +134,10 @@ QPainterPath TextEditorOverlay::createSelectionPath(const QTextCursor &begin, co
int x = line.cursorToX(pos);
lineRect.setLeft(x - borderWidth);
lineRect.setRight(x + borderWidth);
lineRect.setBottom(lineRect.bottom() + borderWidth);
QPainterPath path;
path.addRect(lineRect);
path.translate(offset);
return path;
}
@@ -250,6 +252,8 @@ void TextEditorOverlay::paintSelection(QPainter *painter,
return;
QPainterPath path = createSelectionPath(begin, end, clip);
if (path.isEmpty())
return;
painter->save();
QColor penColor = fg;
@@ -305,6 +309,8 @@ void TextEditorOverlay::fillSelection(QPainter *painter,
return;
QPainterPath path = createSelectionPath(begin, end, clip);
if (path.isEmpty())
return;
painter->save();
painter->translate(-.5, -.5);

View File

@@ -133,7 +133,7 @@ void TextMark::paintAnnotation(QPainter &painter,
const QColor &markColor = annotationColor();
const FontSettings &fontSettings = m_baseTextDocument->fontSettings();
const AnnotationColors &colors = AnnotationColors::getAnnotationColors(
const AnnotationColors colors = AnnotationColors::getAnnotationColors(
markColor.isValid() ? markColor : painter.pen().color(),
fontSettings.toTextCharFormat(C_TEXT).background().color());