diff --git a/examples/common/imgui/imgui.cpp b/examples/common/imgui/imgui.cpp index afc2957c..4997d8dd 100644 --- a/examples/common/imgui/imgui.cpp +++ b/examples/common/imgui/imgui.cpp @@ -3415,12 +3415,14 @@ bool imguiCheck(const char* _text, bool _checked, bool _enabled) return s_imgui.check(_text, _checked, _enabled); } -void imguiBool(const char* _text, bool& _flag, bool _enabled) +bool imguiBool(const char* _text, bool& _flag, bool _enabled) { - if (imguiCheck(_text, _flag, _enabled) ) + bool result = imguiCheck(_text, _flag, _enabled); + if (result) { _flag = !_flag; } + return result; } bool imguiCollapse(const char* _text, const char* _subtext, bool _checked, bool _enabled) diff --git a/examples/common/imgui/imgui.h b/examples/common/imgui/imgui.h index e85b9d3a..5237490c 100644 --- a/examples/common/imgui/imgui.h +++ b/examples/common/imgui/imgui.h @@ -173,7 +173,7 @@ void imguiSetCurrentScissor(); // Call before drawing custom widgets over imgui bool imguiButton(const char* _text, bool _enabled = true, ImguiAlign::Enum _align = ImguiAlign::LeftIndented, uint32_t _rgb0 = IMGUI_BUTTON_RGB0, int32_t _r = IMGUI_BUTTON_R); bool imguiItem(const char* _text, bool _enabled = true); bool imguiCheck(const char* _text, bool _checked, bool _enabled = true); -void imguiBool(const char* _text, bool& _flag, bool _enabled = true); +bool imguiBool(const char* _text, bool& _flag, bool _enabled = true); bool imguiCollapse(const char* _text, const char* _subtext, bool _checked, bool _enabled = true); void imguiLabel(const char* _format, ...); void imguiLabel(uint32_t _rgba, const char* _format, ...);