mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-07 13:35:49 +02:00
Overlap: Internals: add NextItemData.ItemFlags to facilitate implementation of SetNextItemAllowOverlap() + potentially remove extra_flags from ItemAdd(). (#6512, #3909)
This commit is contained in:
@ -1163,10 +1163,8 @@ bool ImGui::CheckboxFlagsT(const char* label, T* flags, T flags_value)
|
||||
if (!all_on && any_on)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiItemFlags backup_item_flags = g.CurrentItemFlags;
|
||||
g.CurrentItemFlags |= ImGuiItemFlags_MixedValue;
|
||||
g.NextItemData.ItemFlags |= ImGuiItemFlags_MixedValue;
|
||||
pressed = Checkbox(label, &all_on);
|
||||
g.CurrentItemFlags = backup_item_flags;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -4959,11 +4957,9 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
{
|
||||
// For focus requests to work on our multiline we need to ensure our child ItemAdd() call specifies the ImGuiItemFlags_Inputable (ref issue #4761)...
|
||||
Dummy(ImVec2(text_size.x, text_size.y + style.FramePadding.y));
|
||||
ImGuiItemFlags backup_item_flags = g.CurrentItemFlags;
|
||||
g.CurrentItemFlags |= ImGuiItemFlags_Inputable | ImGuiItemFlags_NoTabStop;
|
||||
g.NextItemData.ItemFlags |= ImGuiItemFlags_Inputable | ImGuiItemFlags_NoTabStop;
|
||||
EndChild();
|
||||
item_data_backup.StatusFlags |= (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HoveredWindow);
|
||||
g.CurrentItemFlags = backup_item_flags;
|
||||
|
||||
// ...and then we need to undo the group overriding last item data, which gets a bit messy as EndGroup() tries to forward scrollbar being active...
|
||||
// FIXME: This quite messy/tricky, should attempt to get rid of the child window.
|
||||
|
Reference in New Issue
Block a user