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

docking
omar 6 years ago
parent b53630813e
commit 1391904fd2

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

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

Loading…
Cancel
Save