Skip to content

Commit

Permalink
Selectable/MenuItem: Not activated on Click but only on Release is mo…
Browse files Browse the repository at this point in the history
…re 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.
  • Loading branch information
ocornut committed Aug 7, 2016
1 parent 8828889 commit 761a74c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 761a74c

Please sign in to comment.