2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

not sending typing status when working with inline bots

This commit is contained in:
John Preston
2016-01-02 08:58:43 +08:00
parent 4426e2dd78
commit d8b1df875e
5 changed files with 33 additions and 23 deletions

View File

@@ -1355,15 +1355,13 @@ struct MessageCursor {
QScrollBar *s = edit.verticalScrollBar();
scroll = (s && (s->value() != s->maximum())) ? s->value() : QFIXED_MAX;
}
void applyTo(QTextEdit &edit, bool *lock = 0) {
if (lock) *lock = true;
void applyTo(QTextEdit &edit) {
QTextCursor c = edit.textCursor();
c.setPosition(anchor, QTextCursor::MoveAnchor);
c.setPosition(position, QTextCursor::KeepAnchor);
edit.setTextCursor(c);
QScrollBar *s = edit.verticalScrollBar();
if (s) s->setValue(scroll);
if (lock) *lock = false;
}
int position, anchor, scroll;
};