giu icon indicating copy to clipboard operation
giu copied to clipboard

setTheme() override callback/disablement

Open Chillance opened this issue 4 months ago • 3 comments

Related problem

No response

Your request

I was going through the code to see what is going on "under the hood" and found the setTheme method that is run every frame. Now, it might not matter much, but I still wanted to bring it up and see what you say.

If I want to change Theme/Style this setTheme will still always run and thus waste CPU time. I suppose I can set the style so that is good, and no callback would be needed for being able to set the theme, but that means it would still do this internal one and then override with my style. Seems a bit wasteful doing the internal one in this case. So, maybe introduce a way to have a callback for it, override with a custom one, and/or just disable the internal one?

Best Regards!

Alternative solution

No response

Additional context

No response

Chillance avatar Feb 23 '24 19:02 Chillance

yeah, Thats a good idea.

However its not my highest priority right now as I need to re-enable all features that was disabled since migration (e.g. Markdown support) and this needs much work in cimgui-go.

gucio321 avatar Feb 23 '24 20:02 gucio321

Yeah, understandable. Thoughts on how you see this implemented? Override with callback? Disable/Enable? Having it there is not bad, but a boolean to do it or not at least would be nice.

Chillance avatar Feb 23 '24 20:02 Chillance

I think callback will be fine. If user wants to keep defaults, they can just pass empty function.

gucio321 avatar Feb 24 '24 17:02 gucio321