When the user sends or receives a message, and the chatroom is right at the bottom, the chatroom view should automatically scroll down the view to the bottom.
If chatroom is not right at the bottom, no scroll operation is needed.
My Attempt
let adjustment = view.vadjustment();
adjustment.connect_changed(|adjustment| {
// Scroll down the view
let view_height = adjustment.upper() - adjustment.page_size();
adjustment.set_value(view_height);
});
That's what I wrote trying to implement this function. However, it has a weird behaviour:
Requirements Description
My Attempt
That's what I wrote trying to implement this function. However, it has a weird behaviour:
https://user-images.githubusercontent.com/21173956/169246535-3ce22603-9ad6-4675-a57b-790deb28fc82.mp4
As the video shows: the scrollbar updates, while the view does not.
Hopefully this message does help to you if you want to contribute about it.
PR WELCOME