Expose some more box scroll interface parts.

This commit is contained in:
John Preston 2023-03-30 15:49:32 +04:00
parent 7e5ac77096
commit 80505c1216
2 changed files with 22 additions and 0 deletions

View file

@ -179,6 +179,24 @@ void BoxContent::scrollToY(int top, int bottom) {
} }
} }
void BoxContent::sendScrollViewportEvent(not_null<QEvent*> event) {
if (_scroll) {
_scroll->viewportEvent(event);
}
}
rpl::producer<> BoxContent::scrolls() const {
return _scroll ? _scroll->scrolls() : rpl::never<>();
}
int BoxContent::scrollTop() const {
return _scroll ? _scroll->scrollTop() : 0;
}
int BoxContent::scrollHeight() const {
return _scroll ? _scroll->height() : 0;
}
void BoxContent::scrollByDraggingDelta(int delta) { void BoxContent::scrollByDraggingDelta(int delta) {
_draggingScroll.checkDeltaScroll(_scroll ? delta : 0); _draggingScroll.checkDeltaScroll(_scroll ? delta : 0);
} }

View file

@ -209,6 +209,10 @@ public:
void scrollByDraggingDelta(int delta); void scrollByDraggingDelta(int delta);
void scrollToY(int top, int bottom = -1); void scrollToY(int top, int bottom = -1);
void sendScrollViewportEvent(not_null<QEvent*> event);
[[nodiscard]] rpl::producer<> scrolls() const;
[[nodiscard]] int scrollTop() const;
[[nodiscard]] int scrollHeight() const;
protected: protected:
virtual void prepare() = 0; virtual void prepare() = 0;