From 57e9651a8a41ba0c76538d87305f1306a2a5247a Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 21 Apr 2020 13:34:36 +0400 Subject: [PATCH] Fix visual glitch in poll results viewing. We need a visible widget to mark more button height. An invisible 'more' button doesn't receive geometry change events. --- .../info/polls/info_polls_results_inner_widget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp b/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp index c8ac40db5..88d0263a6 100644 --- a/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp +++ b/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp @@ -579,6 +579,9 @@ ListController *CreateAnswerRows( headerWrap->resize(headerWrap->width(), height); }, header->lifetime()); + auto moreTopWidget = object_ptr(container); + moreTopWidget->resize(0, 0); + const auto moreTop = container->add(std::move(moreTopWidget)); const auto more = container->add( object_ptr>( container, @@ -604,7 +607,7 @@ ListController *CreateAnswerRows( rpl::combine( std::move(visibleTop), headerWrap->geometryValue(), - more->topValue() + moreTop->topValue() ) | rpl::filter([=](int, QRect headerRect, int moreTop) { return moreTop >= headerRect.y() + headerRect.height(); }) | rpl::start_with_next([=](