mirror of
https://github.com/ocornut/imgui.git
synced 2026-05-27 19:15:24 +08:00
Internals: store ImGuiItemStatusFlags_EditedInternal bypassing ImGuiItemFlags_NoMarkEdited.
Convenient if the same signal is not passed via e.g. return value. (#8665, #9299, #8065, #3946, #6284, #9117)
This commit is contained in:
@@ -4753,8 +4753,12 @@ void ImGui::MarkItemEdited(ImGuiID id)
|
|||||||
// This marking is to be able to provide info for IsItemDeactivatedAfterEdit().
|
// This marking is to be able to provide info for IsItemDeactivatedAfterEdit().
|
||||||
// ActiveId might have been released by the time we call this (as in the typical press/release button behavior) but still need to fill the data.
|
// ActiveId might have been released by the time we call this (as in the typical press/release button behavior) but still need to fill the data.
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
|
|
||||||
|
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_EditedInternal;
|
||||||
if (g.LastItemData.ItemFlags & ImGuiItemFlags_NoMarkEdited)
|
if (g.LastItemData.ItemFlags & ImGuiItemFlags_NoMarkEdited)
|
||||||
return;
|
return;
|
||||||
|
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_Edited;
|
||||||
|
|
||||||
if (g.ActiveId == id || g.ActiveId == 0)
|
if (g.ActiveId == id || g.ActiveId == 0)
|
||||||
{
|
{
|
||||||
// FIXME: Can't we fully rely on LastItemData yet?
|
// FIXME: Can't we fully rely on LastItemData yet?
|
||||||
@@ -4768,9 +4772,6 @@ void ImGui::MarkItemEdited(ImGuiID id)
|
|||||||
// We accept 'ActiveIdPreviousFrame == id' for InputText() returning an edit after it has been taken ActiveId away (#4714)
|
// We accept 'ActiveIdPreviousFrame == id' for InputText() returning an edit after it has been taken ActiveId away (#4714)
|
||||||
// FIXME: This assert is getting a bit meaningless over time. It helped detect some unusual use cases but eventually it is becoming an unnecessary restriction.
|
// FIXME: This assert is getting a bit meaningless over time. It helped detect some unusual use cases but eventually it is becoming an unnecessary restriction.
|
||||||
IM_ASSERT(g.DragDropActive || g.ActiveId == id || g.ActiveId == 0 || g.ActiveIdPreviousFrame == id || g.NavJustMovedToId || (g.CurrentMultiSelect != NULL && g.BoxSelectState.IsActive));
|
IM_ASSERT(g.DragDropActive || g.ActiveId == id || g.ActiveId == 0 || g.ActiveIdPreviousFrame == id || g.NavJustMovedToId || (g.CurrentMultiSelect != NULL && g.BoxSelectState.IsActive));
|
||||||
|
|
||||||
//IM_ASSERT(g.CurrentWindow->DC.LastItemId == id);
|
|
||||||
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_Edited;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImGui::IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags)
|
bool ImGui::IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFlags flags)
|
||||||
|
|||||||
@@ -1005,6 +1005,7 @@ enum ImGuiItemStatusFlags_
|
|||||||
ImGuiItemStatusFlags_HasClipRect = 1 << 9, // g.LastItemData.ClipRect is valid.
|
ImGuiItemStatusFlags_HasClipRect = 1 << 9, // g.LastItemData.ClipRect is valid.
|
||||||
ImGuiItemStatusFlags_HasShortcut = 1 << 10, // g.LastItemData.Shortcut valid. Set by SetNextItemShortcut() -> ItemAdd().
|
ImGuiItemStatusFlags_HasShortcut = 1 << 10, // g.LastItemData.Shortcut valid. Set by SetNextItemShortcut() -> ItemAdd().
|
||||||
//ImGuiItemStatusFlags_FocusedByTabbing = 1 << 8, // Removed IN 1.90.1 (Dec 2023). The trigger is part of g.NavActivateId. See commit 54c1bdeceb.
|
//ImGuiItemStatusFlags_FocusedByTabbing = 1 << 8, // Removed IN 1.90.1 (Dec 2023). The trigger is part of g.NavActivateId. See commit 54c1bdeceb.
|
||||||
|
ImGuiItemStatusFlags_EditedInternal = 1 << 11, // Similar to ImGuiItemStatusFlags_Edited but bypassing ImGuiItemFlags_NoMarkEdited.
|
||||||
|
|
||||||
// Additional status + semantic for ImGuiTestEngine
|
// Additional status + semantic for ImGuiTestEngine
|
||||||
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
||||||
|
|||||||
Reference in New Issue
Block a user