Comments (4)
Also just a good thing to know in general haha. So we keep the built widgets in
current_widgets
so that we don't have to re-build them, right?
Yep
from kayak_ui.
Using diffing (not sure if Re-enable Diffing #1 has been resolved or not), we could get a list of all the Change::Deleted nodes. Then we just iterate over them and manually remove the necessary data from KayakContext. This method is probably slower and more cumbersome, but probably much simpler to implement with adequate diffing.
Diffing isn't fixed yet. We need to wrap props in Binding<Prop>
inside the widget proc macros. Once that's done we can ignore updating children. No need to diff either since the notify on the Binding does that for us. Once I'm back to working on kayak again I'll probably pick this task up first.
Utilize a crate like weak_table, to create the data HashMap and HashSet fields. Then add a trait method to Widget allowing it to return a reference to its Index (or maybe a custom wrapper struct). This way we could use a Weak as the key to automatically drop the stored data when the widget is removed. This way is a bit cleaner, but adds a dependency and requires changing a lot more code to integrate it. (Just did some quick testing and I guess widgets are dropped every render? I assume when rebuilding the tree? So maybe this whole idea wouldn't work anyways...)
We can use Change::Deleted
with an iterator. We'll already have a Index to the widget there that we can use to delete all of its relevant data. Currently widget's are removed only from the tree.
from kayak_ui.
Diffing isn't fixed yet. We need to wrap props in
Binding<Prop>
inside the widget proc macros. Once that's done we can ignore updating children. No need to diff either since the notify on the Binding does that for us. Once I'm back to working on kayak again I'll probably pick this task up first.
Sounds good. And, yeah, just wanted to mark down the issue. There's no rush to come back 🙂
We can use Change::Deleted with an iterator. We'll already have a Index to the widget there that we can use to delete all of its relevant data. Currently widget's are removed only from the tree.
Yeah that's what I figured. That should be a fine solution, we'll just have to make sure we properly remove the data when they should be removed.
Also just a good thing to know in general haha. So we keep the built widgets in current_widgets
so that we don't have to re-build them, right?
from kayak_ui.
Fixed with the rewrite! 👍 Please reopen if you feel as though this is still an issue.
from kayak_ui.
Related Issues (20)
- Use Dashmap to replace `Rwlock<Hashmap>`
- UI materials have some usability friction when used to bevy shaders
- UI materials do not seem to respect z-ordering
- Quads with borders cannot have a transparent background HOT 1
- Using multiple shader materials causes them to render on eachother's elements
- Small text gets white boxes
- tree::should_remove_root test failed
- Make `Tree` have internal mutablity
- hello_world example is blank when copied into project HOT 3
- Input lag HOT 1
- Text Rendering Inverted HOT 2
- Is there a way to import Chinese fonts? HOT 1
- Add support for text outlines
- Dynamically rendering widgets inside the rsx! block ? HOT 1
- Consider removing the 'Styles' (KStyle) as an input, only leaving ComputedStyles
- I dont understand why widgets wrapped inside of a ContextProvider need to have a 'computed styles' HOT 1
- Consider removing 'computed styles' entirely from custom widgets
- Missing example: mouse cursor position to render position
- Can't query custom widget props HOT 1
- Font loading from subdirectories fails for nested .ttf files
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kayak_ui.