From 122ab94f3d4688de828562f2aaf2bb6d4e3e99cf Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 7 Jun 2018 21:25:10 +0300 Subject: [PATCH] Fix text color glitch after palette update. Once again fixes #4774. --- Telegram/SourceFiles/ui/widgets/input_fields.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Telegram/SourceFiles/ui/widgets/input_fields.cpp b/Telegram/SourceFiles/ui/widgets/input_fields.cpp index 952cdf378a..1399be385d 100644 --- a/Telegram/SourceFiles/ui/widgets/input_fields.cpp +++ b/Telegram/SourceFiles/ui/widgets/input_fields.cpp @@ -1246,6 +1246,16 @@ void InputField::updatePalette() { } } } + + cursor = textCursor(); + if (!cursor.hasSelection()) { + auto format = cursor.charFormat(); + format.merge(PrepareTagFormat( + _st, + format.property(kTagProperty).toString())); + cursor.setCharFormat(format); + setTextCursor(cursor); + } } void InputField::onTouchTimer() {