forked from qt-creator/qt-creator
Terminal: Fix preedit area position
Change-Id: I8667a84e12154ca34517af25648a0983f918fc48 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -617,11 +617,10 @@ void TerminalWidget::paintEvent(QPaintEvent *event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!m_preEditString.isEmpty()) {
|
if (!m_preEditString.isEmpty()) {
|
||||||
// TODO: Use QTextLayout::setPreeditArea() instead ?
|
|
||||||
QTextLine cursorLine = m_textLayout.lineAt(m_cursor.row);
|
QTextLine cursorLine = m_textLayout.lineAt(m_cursor.row);
|
||||||
if (cursorLine.isValid()) {
|
if (cursorLine.isValid()) {
|
||||||
int pos = cursorLine.textStart() + m_cursor.col;
|
int pos = cursorLine.textStart() + m_cursor.col;
|
||||||
QPointF displayPos = QPointF{cursorLine.cursorToX(pos), cursorLine.y()};
|
QPointF displayPos = QPointF{cursorLine.cursorToX(pos), cursorLine.y() + y};
|
||||||
|
|
||||||
p.fillRect(QRectF{displayPos.toPoint(), m_cellSize}, QColor::fromRgb(0, 0, 0));
|
p.fillRect(QRectF{displayPos.toPoint(), m_cellSize}, QColor::fromRgb(0, 0, 0));
|
||||||
p.setPen(Qt::white);
|
p.setPen(Qt::white);
|
||||||
|
|||||||
Reference in New Issue
Block a user