Internals: Selectable: Added ImGuiSelectableFlags_AllowItemOverlap in imgui_internal.h (~ #684, #2341)

This commit is contained in:
omar 2019-04-08 17:27:17 +02:00
parent b53630813e
commit 1391904fd2
2 changed files with 7 additions and 1 deletions

View File

@ -344,7 +344,8 @@ enum ImGuiSelectableFlagsPrivate_
ImGuiSelectableFlags_NoHoldingActiveID = 1 << 10,
ImGuiSelectableFlags_PressedOnClick = 1 << 11,
ImGuiSelectableFlags_PressedOnRelease = 1 << 12,
ImGuiSelectableFlags_DrawFillAvailWidth = 1 << 13
ImGuiSelectableFlags_DrawFillAvailWidth = 1 << 13,
ImGuiSelectableFlags_AllowItemOverlap = 1 << 14
};
enum ImGuiSeparatorFlags_

View File

@ -5308,6 +5308,8 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
if (flags & ImGuiSelectableFlags_PressedOnRelease) button_flags |= ImGuiButtonFlags_PressedOnRelease;
if (flags & ImGuiSelectableFlags_Disabled) button_flags |= ImGuiButtonFlags_Disabled;
if (flags & ImGuiSelectableFlags_AllowDoubleClick) button_flags |= ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnDoubleClick;
if (flags & ImGuiSelectableFlags_AllowItemOverlap) button_flags |= ImGuiButtonFlags_AllowItemOverlap;
if (flags & ImGuiSelectableFlags_Disabled)
selected = false;
@ -5323,6 +5325,9 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
if (pressed)
MarkItemEdited(id);
if (flags & ImGuiSelectableFlags_AllowItemOverlap)
SetItemAllowOverlap();
// Render
if (hovered || selected)
{