-
-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for virtualized widget lists? #277
Comments
I read a bit about this because I was not familiar with this new feature. I was thinking maybe we could do the following: Add an attribute above a property binding and specify somehow a message to be sent for the If I convert the code (not the builder one) example from the link above to this idea in relm, we would have: fn update(&mut self, msg: Msg) {
match msg {
Msg::Bind(list_item) {
self.model.icon = list_item.get_item().unwrap().get_icon();
},
}
}
view! {
gtk::Image {
icon_size: IconSize::Large,
#[binding]
from_gicon: &self.model.icon,
}
} But I'm not sure this is convenient, as we would need to initialize the Now that I think of it, maybe it's simplest to do nothing special in
What do you think? Edit: Actually, I don't think it makes sense to send the Maybe if I see a more complex example using a Builder (ui) file, I would have more ideas to port this to relm. |
Yes.. I'm myself not familiar with the API, i'm just feeling the pain that the API is supposed to relieve :) For examples I usually look at I'm relieved you think that relm could support the feature. I was worried that there was a conflict between the gtk recycling widgets that I imagine is going on and relm's component lifecycle (although the factory pattern means that maybe there is no recycling.. honestly I didn't dig too much into this). As for myself, since I need the feature now and I think I won't find the time to help in the porting of relm to gtk4 and the introduction of this feature, I'm likely to again down the path of using a gtk drawingarea and manual render to achieve good performance with large (thousands of items and more) widget lists (what I get are not really widget lists, but they look and feel like such to the user). |
The only conflict I could see would be if you create bindings in Yeah, for the porting to gtk4, I'm very busy these days, but I should have more time in a few weeks and there's the Rust+GNOME hackfest coming soon, so I'll probably work on this during the hackfest. |
no problem of course! I just wanted to get an idea whether it was feasible and point this out as, in my mind, an important feature of gtk4. Thanks again for relm! Pretty sure I wouldn't be doing any gtk these days without it. |
i'm having a great time writing relm apps, but my #1 issue is the memory use when adding many relm widget to a gtk
ListBox
. I actually once drew my big list in aDrawingArea
to work around this. This is not specifically a relm problem, that's a gtk problem, and it seems they've fixed it in gtk4: https://blog.gtk.org/2020/06/07/scalable-lists-in-gtk-4/So I've been expecting for a while that this issue gets fixed when relm supports gtk4, but now I started to worry that it's not enough that gtk4 offers that, it might be quite some work for relm to also support the concept of virtualized widget lists, where components get recycled as the user scrolls the list? I am curious, do you think it's achievable for relm without big changes?
The text was updated successfully, but these errors were encountered: