mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-03 16:15:13 +00:00
Clear formatting at the start of the field.
This commit is contained in:
@@ -1122,6 +1122,7 @@ InputField::InputField(
|
||||
connect(_inner->document(), SIGNAL(contentsChange(int,int,int)), this, SLOT(onDocumentContentsChange(int,int,int)));
|
||||
connect(_inner, SIGNAL(undoAvailable(bool)), this, SLOT(onUndoAvailable(bool)));
|
||||
connect(_inner, SIGNAL(redoAvailable(bool)), this, SLOT(onRedoAvailable(bool)));
|
||||
connect(_inner, SIGNAL(cursorPositionChanged()), this, SLOT(onCursorPositionChanged()));
|
||||
if (App::wnd()) connect(_inner, SIGNAL(selectionChanged()), App::wnd(), SLOT(updateGlobalMenu()));
|
||||
|
||||
const auto bar = _inner->verticalScrollBar();
|
||||
@@ -1979,6 +1980,14 @@ void InputField::onDocumentContentsChange(
|
||||
}
|
||||
}
|
||||
|
||||
void InputField::onCursorPositionChanged() {
|
||||
auto cursor = textCursor();
|
||||
if (!cursor.hasSelection() && !cursor.position()) {
|
||||
cursor.setCharFormat(_defaultCharFormat);
|
||||
setTextCursor(cursor);
|
||||
}
|
||||
}
|
||||
|
||||
void InputField::chopByMaxLength(int insertPosition, int insertLength) {
|
||||
Expects(_correcting);
|
||||
|
||||
|
Reference in New Issue
Block a user