From 761a74c62b4d55fb42eae32bfa0b321c3f601ced Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 7 Aug 2016 20:21:18 +0200 Subject: [PATCH] Selectable/MenuItem: Not activated on Click but only on Release is more standard (#126, #245, #323) Apparently menu items started with OnClick (vs OnClickHoldRelease) when doing #126. Hope to not break anything. Also allows using xxx_DontClosePopup flags. --- imgui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index 1b5c5f0242b2..75c45e379da2 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9467,7 +9467,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl ImGuiButtonFlags button_flags = 0; if (flags & ImGuiSelectableFlags_Menu) button_flags |= ImGuiButtonFlags_PressedOnClick; - if (flags & ImGuiSelectableFlags_MenuItem) button_flags |= ImGuiButtonFlags_PressedOnClick|ImGuiButtonFlags_PressedOnRelease; + if (flags & ImGuiSelectableFlags_MenuItem) button_flags |= ImGuiButtonFlags_PressedOnRelease; if (flags & ImGuiSelectableFlags_Disabled) button_flags |= ImGuiButtonFlags_Disabled; if (flags & ImGuiSelectableFlags_AllowDoubleClick) button_flags |= ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnDoubleClick; bool hovered, held;