Skip to content

Rehighlight TextEditor when Theme changes#2818

Merged
hecrj merged 3 commits intoiced-rs:masterfrom
pml68:feat/rehighlight-on-redraw
Nov 21, 2025
Merged

Rehighlight TextEditor when Theme changes#2818
hecrj merged 3 commits intoiced-rs:masterfrom
pml68:feat/rehighlight-on-redraw

Conversation

@pml68
Copy link
Contributor

@pml68 pml68 commented Feb 25, 2025

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

@edwloef
Copy link
Contributor

edwloef commented Feb 27, 2025

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
Copy link
Contributor Author

pml68 commented Feb 27, 2025

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
Copy link
Contributor Author

pml68 commented Feb 27, 2025

@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 pml68 changed the title Simple „solution” to #2817 Rehighlight TextEditor when Theme changes Feb 27, 2025
@pml68
Copy link
Contributor Author

pml68 commented Feb 27, 2025

This solves #2817

@acidjazz
Copy link

Would be awesome if this got merged - really helpful 👍

@pml68 pml68 force-pushed the feat/rehighlight-on-redraw branch from 64d4a36 to 11c9154 Compare April 28, 2025 22:00
@pml68 pml68 force-pushed the feat/rehighlight-on-redraw branch from 11c9154 to e0106e3 Compare May 12, 2025 21:36
@pml68 pml68 force-pushed the feat/rehighlight-on-redraw branch from e0106e3 to acebcd1 Compare June 24, 2025 22:06
@pml68 pml68 force-pushed the feat/rehighlight-on-redraw branch from acebcd1 to 5453ec4 Compare July 22, 2025 17:22
@pml68 pml68 force-pushed the feat/rehighlight-on-redraw branch 2 times, most recently from 9515890 to 4dc1a8b Compare August 6, 2025 17:15
@pml68 pml68 force-pushed the feat/rehighlight-on-redraw branch from 4dc1a8b to e634a87 Compare August 21, 2025 13:45
@pml68 pml68 force-pushed the feat/rehighlight-on-redraw branch from e634a87 to eae40b6 Compare September 29, 2025 07:35
@pml68 pml68 force-pushed the feat/rehighlight-on-redraw branch from eae40b6 to 29864c0 Compare October 9, 2025 15:30
@pml68 pml68 force-pushed the feat/rehighlight-on-redraw branch from 29864c0 to 49a5714 Compare November 14, 2025 11:39
@hecrj hecrj force-pushed the feat/rehighlight-on-redraw branch 2 times, most recently from 876ce3a to 168a2f0 Compare November 21, 2025 00:09
@hecrj hecrj force-pushed the feat/rehighlight-on-redraw branch from 168a2f0 to 0495f32 Compare November 21, 2025 00:09
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I have introduced a name method to theme::Base so we can just leverage that instead of adding a generic with PartialEq and Clone requirements.

Not as perfect, but it should be good enough for most use cases.

@hecrj hecrj enabled auto-merge November 21, 2025 00:13
@hecrj hecrj added this to the 0.14 milestone Nov 21, 2025
@hecrj hecrj added bug Something isn't working text styling fix widget labels Nov 21, 2025
@hecrj hecrj merged commit 0bf00d0 into iced-rs:master Nov 21, 2025
15 checks passed
@pml68 pml68 deleted the feat/rehighlight-on-redraw branch November 21, 2025 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants