lomirus / gtk-qq

Unofficial Linux QQ client, based on GTK4 and libadwaita, developed with Rust and Relm4.
GNU Affero General Public License v3.0
200 stars 13 forks source link

Scroll down chatroom view aumatically when pushing new message. #5

Open lomirus opened 2 years ago

lomirus commented 2 years ago

Requirements Description

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:

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

Goodjooy commented 2 years ago

我将那部分代码加入后测试的结果是: 会滚动,但是不会滚动到底,大概会距离滚动到底差一个对话框

Sinofine commented 2 years ago

https://github.com/melix99/telegrand/issues/13