diff --git a/Telegram/SourceFiles/statistics/chart_widget.cpp b/Telegram/SourceFiles/statistics/chart_widget.cpp index 631e1450bc..48410896d8 100644 --- a/Telegram/SourceFiles/statistics/chart_widget.cpp +++ b/Telegram/SourceFiles/statistics/chart_widget.cpp @@ -19,6 +19,10 @@ namespace { constexpr auto kHeightLimitsUpdateTimeout = crl::time(320); +[[nodiscard]] bool AnimFinished(const anim::value &anim) { + return anim.current() == anim.to(); +} + [[nodiscard]] int FindMaxValue( Data::StatisticalChart &chartData, int startXIndex, @@ -75,12 +79,14 @@ public: Footer(not_null parent); [[nodiscard]] rpl::producer xPercentageLimitsChange() const; + [[nodiscard]] rpl::producer<> userInteractionFinished() const; private: not_null _left; not_null _right; rpl::event_stream _xPercentageLimitsChange; + rpl::event_stream<> _userInteractionFinished; struct { int x = 0; @@ -148,6 +154,7 @@ ChartWidget::Footer::Footer(not_null parent) .min = _left->x() / float64(width()), .max = rect::right(_right) / float64(width()), }); + _userInteractionFinished.fire({}); _start = {}; } break; } @@ -167,6 +174,10 @@ rpl::producer ChartWidget::Footer::xPercentageLimitsChange() const { return _xPercentageLimitsChange.events(); } +rpl::producer<> ChartWidget::Footer::userInteractionFinished() const { + return _userInteractionFinished.events(); +} + ChartWidget::ChartWidget(not_null parent) : Ui::RpWidget(parent) , _footer(std::make_unique