mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
update block when changing cursor block mode
This commit is contained in:
parent
faff0cd8f6
commit
76ff1ff756
@ -354,12 +354,15 @@ void VTextEdit::setImageLineColor(const QColor &p_color)
|
||||
|
||||
void VTextEdit::setCursorBlockMode(CursorBlock p_mode)
|
||||
{
|
||||
VTextDocumentLayout *layout = getLayout();
|
||||
|
||||
if (p_mode != m_cursorBlockMode) {
|
||||
m_cursorBlockMode = p_mode;
|
||||
getLayout()->setCursorBlockMode(m_cursorBlockMode);
|
||||
getLayout()->clearLastCursorBlockWidth();
|
||||
layout->setCursorBlockMode(m_cursorBlockMode);
|
||||
layout->clearLastCursorBlockWidth();
|
||||
setCursorWidth(m_cursorBlockMode != CursorBlock::None ? VIRTUAL_CURSOR_BLOCK_WIDTH
|
||||
: 1);
|
||||
layout->updateBlockByNumber(textCursor().blockNumber());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user