Expose some more box scroll interface parts.
This commit is contained in:
parent
7e5ac77096
commit
80505c1216
2 changed files with 22 additions and 0 deletions
|
|
@ -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) {
|
||||
_draggingScroll.checkDeltaScroll(_scroll ? delta : 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -209,6 +209,10 @@ public:
|
|||
void scrollByDraggingDelta(int delta);
|
||||
|
||||
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:
|
||||
virtual void prepare() = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue