From 0b22e5928ca5e6822fe36becc659355d3575f10c Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 29 Mar 2024 03:15:13 +0300 Subject: [PATCH] Fixed bottom fade effect for input message fields in compose controls. --- Telegram/SourceFiles/chat_helpers/message_field.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/chat_helpers/message_field.cpp b/Telegram/SourceFiles/chat_helpers/message_field.cpp index c5c04a43c..648c5c98c 100644 --- a/Telegram/SourceFiles/chat_helpers/message_field.cpp +++ b/Telegram/SourceFiles/chat_helpers/message_field.cpp @@ -505,7 +505,11 @@ void InitMessageFieldFade( }, topFade->lifetime()); topFade->show(); - bottomFade->show(); + bottomFade->showOn( + field->scrollTop().value( + ) | rpl::map([field, descent = field->st().font->descent](int scroll) { + return (scroll + descent) < field->scrollTopMax(); + }) | rpl::distinct_until_changed()); } InlineBotQuery ParseInlineBotQuery(