Replaced singleShot with InvokeQueued in InputField.

This commit is contained in:
23rd 2021-09-03 16:07:17 +03:00
parent db1b4b65c7
commit 093e3129ab

View file

@ -10,6 +10,7 @@
#include "ui/text/text.h"
#include "ui/emoji_config.h"
#include "ui/ui_utility.h"
#include "base/invoke_queued.h"
#include "base/openssl_help.h"
#include "base/platform/base_platform_info.h"
#include "emoji_suggestions_helper.h"
@ -1778,12 +1779,12 @@ void InputField::focusInEvent(QFocusEvent *e) {
_borderAnimationStart = (e->reason() == Qt::MouseFocusReason)
? mapFromGlobal(QCursor::pos()).x()
: (width() / 2);
QTimer::singleShot(0, this, SLOT(onFocusInner()));
InvokeQueued(this, [=] { onFocusInner(); });
}
void InputField::mousePressEvent(QMouseEvent *e) {
_borderAnimationStart = e->pos().x();
QTimer::singleShot(0, this, SLOT(onFocusInner()));
InvokeQueued(this, [=] { onFocusInner(); });
}
void InputField::onFocusInner() {