We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 724de2e commit 44e025bCopy full SHA for 44e025b
1 file changed
ui/widgets/scroll_area.h
@@ -253,4 +253,18 @@ class ScrollArea : public RpWidgetBase<QScrollArea> {
253
254
};
255
256
+template <typename Scroll>
257
+void SetStickyBottomScroll(
258
+ not_null<Scroll*> scroll,
259
+ not_null<RpWidget*> inner) {
260
+ inner->heightValue(
261
+ ) | rpl::combine_previous(
262
+ ) | rpl::on_next([=](int previous, int height) {
263
+ if (scroll->scrollTop() + scroll->scrollHeight() >= previous) {
264
+ const auto visible = scroll->scrollHeight();
265
+ scroll->scrollToY(height - visible, height);
266
+ }
267
+ }, inner->lifetime());
268
+}
269
+
270
} // namespace Ui
0 commit comments