iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
26.34k stars 1.28k forks source link

Rehighlight TextEditor when Theme changes #2818

Open pml68 opened 1 month ago

pml68 commented 1 month ago

It's far from perfect, but it's something. Maybe it's even acceptable.

edwloef commented 1 month ago

A better solution to this could be checking whether the theme has changed in the draw function, something like this: https://github.com/generic-daw/generic-daw/blob/d2d1c5f95733cd0169ffe03346491cfb959b9049/generic_daw_gui/src/widget/knob.rs#L205-L213

pml68 commented 1 month ago

I tried doing something like that, but adding PartialEq as a trait requirement to the Theme generic caused issues with the Widget trait, but I'll try again today. Maybe I just didn't read the error carefully.

pml68 commented 1 month ago

@edwloef I'm not sure what I did wrong last night, but it worked just fine this time around. Thanks for making me try again!

pml68 commented 1 month ago

This solves #2817

acidjazz commented 1 week ago

Would be awesome if this got merged - really helpful 👍