|
|
@@ -3833,15 +3833,13 @@ bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags)
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- ImGuiWindowFlags flags = extra_flags|ImGuiWindowFlags_Popup|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoResize|ImGuiWindowFlags_NoSavedSettings;
|
|
|
-
|
|
|
char name[20];
|
|
|
- if (flags & ImGuiWindowFlags_ChildMenu)
|
|
|
+ if (extra_flags & ImGuiWindowFlags_ChildMenu)
|
|
|
ImFormatString(name, IM_ARRAYSIZE(name), "##Menu_%02d", g.CurrentPopupStack.Size); // Recycle windows based on depth
|
|
|
else
|
|
|
ImFormatString(name, IM_ARRAYSIZE(name), "##Popup_%08x", id); // Not recycling, so we can close/open during the same frame
|
|
|
|
|
|
- bool is_open = Begin(name, NULL, flags);
|
|
|
+ bool is_open = Begin(name, NULL, extra_flags | ImGuiWindowFlags_Popup);
|
|
|
if (!is_open) // NB: Begin can return false when the popup is completely clipped (e.g. zero size display)
|
|
|
EndPopup();
|
|
|
|
|
|
@@ -3856,7 +3854,7 @@ bool ImGui::BeginPopup(const char* str_id)
|
|
|
ClearSetNextWindowData(); // We behave like Begin() and need to consume those values
|
|
|
return false;
|
|
|
}
|
|
|
- return BeginPopupEx(g.CurrentWindow->GetID(str_id), ImGuiWindowFlags_AlwaysAutoResize);
|
|
|
+ return BeginPopupEx(g.CurrentWindow->GetID(str_id), ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings);
|
|
|
}
|
|
|
|
|
|
bool ImGui::IsPopupOpen(ImGuiID id)
|
|
|
@@ -3931,7 +3929,7 @@ bool ImGui::BeginPopupContextItem(const char* str_id, int mouse_button)
|
|
|
if (IsMouseClicked(mouse_button))
|
|
|
if (IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup))
|
|
|
OpenPopupEx(id, true);
|
|
|
- return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize);
|
|
|
+ return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings);
|
|
|
}
|
|
|
|
|
|
bool ImGui::BeginPopupContextWindow(const char* str_id, int mouse_button, bool also_over_items)
|
|
|
@@ -3943,7 +3941,7 @@ bool ImGui::BeginPopupContextWindow(const char* str_id, int mouse_button, bool a
|
|
|
if (IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup))
|
|
|
if (also_over_items || !IsAnyItemHovered())
|
|
|
OpenPopupEx(id, true);
|
|
|
- return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize);
|
|
|
+ return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings);
|
|
|
}
|
|
|
|
|
|
bool ImGui::BeginPopupContextVoid(const char* str_id, int mouse_button)
|
|
|
@@ -3953,7 +3951,7 @@ bool ImGui::BeginPopupContextVoid(const char* str_id, int mouse_button)
|
|
|
ImGuiID id = GImGui->CurrentWindow->GetID(str_id);
|
|
|
if (!IsAnyWindowHovered() && IsMouseClicked(mouse_button))
|
|
|
OpenPopupEx(id, true);
|
|
|
- return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize);
|
|
|
+ return BeginPopupEx(id, ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings);
|
|
|
}
|
|
|
|
|
|
static bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags)
|
|
|
@@ -8411,6 +8409,7 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
|
|
|
const bool is_multiline = (flags & ImGuiInputTextFlags_Multiline) != 0;
|
|
|
const bool is_editable = (flags & ImGuiInputTextFlags_ReadOnly) == 0;
|
|
|
const bool is_password = (flags & ImGuiInputTextFlags_Password) != 0;
|
|
|
+ const bool is_undoable = (flags & ImGuiInputTextFlags_NoUndoRedo) == 0;
|
|
|
|
|
|
if (is_multiline) // Open group before calling GetID() because groups tracks id created during their spawn
|
|
|
BeginGroup();
|
|
|
@@ -8637,10 +8636,10 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
|
|
|
if (InputTextFilterCharacter(&c, flags, callback, user_data))
|
|
|
edit_state.OnKeyPressed((int)c);
|
|
|
}
|
|
|
- else if (IsKeyPressedMap(ImGuiKey_Escape)) { clear_active_id = cancel_edit = true; }
|
|
|
- else if (is_shortcut_key_only && IsKeyPressedMap(ImGuiKey_Z) && is_editable) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_UNDO); edit_state.ClearSelection(); }
|
|
|
- else if (is_shortcut_key_only && IsKeyPressedMap(ImGuiKey_Y) && is_editable) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_REDO); edit_state.ClearSelection(); }
|
|
|
- else if (is_shortcut_key_only && IsKeyPressedMap(ImGuiKey_A)) { edit_state.SelectAll(); edit_state.CursorFollow = true; }
|
|
|
+ else if (IsKeyPressedMap(ImGuiKey_Escape)) { clear_active_id = cancel_edit = true; }
|
|
|
+ else if (is_shortcut_key_only && IsKeyPressedMap(ImGuiKey_Z) && is_editable && is_undoable) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_UNDO); edit_state.ClearSelection(); }
|
|
|
+ else if (is_shortcut_key_only && IsKeyPressedMap(ImGuiKey_Y) && is_editable && is_undoable) { edit_state.OnKeyPressed(STB_TEXTEDIT_K_REDO); edit_state.ClearSelection(); }
|
|
|
+ else if (is_shortcut_key_only && IsKeyPressedMap(ImGuiKey_A)) { edit_state.SelectAll(); edit_state.CursorFollow = true; }
|
|
|
else if (is_shortcut_key_only && !is_password && ((IsKeyPressedMap(ImGuiKey_X) && is_editable) || IsKeyPressedMap(ImGuiKey_C)) && (!is_multiline || edit_state.HasSelection()))
|
|
|
{
|
|
|
// Cut, Copy
|
|
|
@@ -9759,7 +9758,7 @@ bool ImGui::BeginMenu(const char* label, bool enabled)
|
|
|
if (menu_is_open)
|
|
|
{
|
|
|
SetNextWindowPos(popup_pos, ImGuiCond_Always);
|
|
|
- ImGuiWindowFlags flags = ImGuiWindowFlags_AlwaysAutoResize | ((window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu)) ? ImGuiWindowFlags_ChildMenu|ImGuiWindowFlags_ChildWindow : ImGuiWindowFlags_ChildMenu);
|
|
|
+ ImGuiWindowFlags flags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings | ((window->Flags & (ImGuiWindowFlags_Popup|ImGuiWindowFlags_ChildMenu)) ? ImGuiWindowFlags_ChildMenu|ImGuiWindowFlags_ChildWindow : ImGuiWindowFlags_ChildMenu);
|
|
|
menu_is_open = BeginPopupEx(id, flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
|
|
|
}
|
|
|
|