imgui_toggle icon indicating copy to clipboard operation
imgui_toggle copied to clipboard

Doesn't apply config rules across windows

Open Skies966 opened this issue 2 years ago • 3 comments

When you select the style of your switch, it is not applied retroactively outside of that window.

Skies966 avatar Sep 10 '23 21:09 Skies966

I'm sorry, I don't follow what you mean here. Could you provide a reproduction example?

nitz avatar Sep 11 '23 13:09 nitz

If you use a global config variable, such as placing it in your header file, and write to it once, it will only apply to the window that contains the style-changing buttons. It will show different switches in each Instance of ImGui::Begin

Skies966 avatar Sep 11 '23 17:09 Skies966

Apologies for being unable to tinker directly as I'm responding from a machine not set up for development, so this is a bit of shooting from the hip here.

Are your other usages on different threads? The shorthand and internal methods for the toggle use a thread local static variable for the config, so that could have something to do with it. The renderer should properly configure on every invocation, but it's not impossible I've missed a case.

If you try manually creating and invoking the renderer passing your config (like is done here, in ToggleInternal()), I wonder if you still have the issue?

nitz avatar Sep 11 '23 17:09 nitz