Merge pull request #1113 from Urmeli0815/ImGuiSelectableFlags_MenuItem

MenuItem: only activate on Release, not on Click (nb: and not on ClickRelease to allow opening menu and selecting something with a single click. Windows seems to behave the same, allowing to click and hold to e.g. Open then move cursor, release on Save and save gets activated)
This commit is contained in:
omar 2017-09-25 22:13:38 +02:00 committed by GitHub
commit 24f21bd4d4

View File

@ -8797,7 +8797,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;