So I am working on a music app, and I need to display data for the user from the database. I’ve tried tarkah’s table, and using the default scrollable, but if I insert ~thousand items, the application falls apart and lags a bunch. I imagine this is because it renders all of the content at once, so some copy of these widgets that rendered only visible content would be great.
I’m not really looking to learn how to make one (mostly since I do not know that much about the library and it may take a while), I just would like a repo / example for one. I really only need the functionality to scroll, add, remove, and select rows (and a way to link selected item -> database entry).
I successfully tried the crate iced_table. But I only need 128 rows.
I suppose for thousands of line a dedicated (automatically loading) database grid is necessary . No idea if something like this already exists in the rust universe. (I once used such in the Delphi / Lazarus world.)
It works pretty well from what I’ve tested. I have no complaints.
The interface is mildly unintuitive at first, but it makes sense from a design decision because (im assuming) that the list::Content\<T> type is held in memory so it is not re-calculated every frame.
You can create your own vertical scroll bar using the slider widget and limit rendering to a fixed number items within the view (depending on the scroll/slider position).
I did this in a log viewer that I’m making. The code isn’t public yet but DM me and I’ll gladly share
Hi @bazizi! I can’t message, my account is too new. Please msg me with details.
I have in mind a secure reader app that
only renders the onscreen text elements
decrypts only the onscreen text elements
displays long form text, where text elements constitute styled paragraphs
the use case is an author/beta-reader app that allows me to secure my unpublished work while receiving feedback directly from my beta-readers. Your strategy sounds precisely like what I had in mind.
I’ve been using Rust since 2017, and have already built an app in iced b0.12.something.
@FerrusDude I suggest trying the feature branch in the iced repo, which implements the proper list widget.
But in case it’ll help, here’s my implementation, which renders a fixed number of elements regardless of screen size. So some elements can be still outside the screen, but it’s still better than rendering the whole table: