Skip to content

Commit 1b9cb52

Browse files
committed
BeginChild(): rename parameters to reduce diff of upcoming patches.
Should be a no-op.
1 parent f8dc03d commit 1b9cb52

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

imgui.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5414,24 +5414,24 @@ ImVec2 ImGui::GetItemRectSize()
54145414
return g.LastItemData.Rect.GetSize();
54155415
}
54165416

5417-
bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags)
5417+
bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, bool border, ImGuiWindowFlags window_flags)
54185418
{
5419-
ImGuiWindow* window = GetCurrentWindow();
5420-
return BeginChildEx(str_id, window->GetID(str_id), size_arg, border, extra_flags);
5419+
ImGuiID id = GetCurrentWindow()->GetID(str_id);
5420+
return BeginChildEx(str_id, id, size_arg, border, window_flags);
54215421
}
54225422

5423-
bool ImGui::BeginChild(ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags extra_flags)
5423+
bool ImGui::BeginChild(ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags window_flags)
54245424
{
54255425
IM_ASSERT(id != 0);
5426-
return BeginChildEx(NULL, id, size_arg, border, extra_flags);
5426+
return BeginChildEx(NULL, id, size_arg, border, window_flags);
54275427
}
54285428

5429-
bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags flags)
5429+
bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags window_flags)
54305430
{
54315431
ImGuiContext& g = *GImGui;
54325432
ImGuiWindow* parent_window = g.CurrentWindow;
5433-
flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_ChildWindow;
5434-
flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove); // Inherit the NoMove flag
5433+
window_flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_ChildWindow;
5434+
window_flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove); // Inherit the NoMove flag
54355435

54365436
// Size
54375437
const ImVec2 content_avail = GetContentRegionAvail();
@@ -5454,7 +5454,7 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b
54545454
g.Style.ChildBorderSize = 0.0f;
54555455

54565456
// Begin into window
5457-
const bool ret = Begin(temp_window_name, NULL, flags);
5457+
const bool ret = Begin(temp_window_name, NULL, window_flags);
54585458
g.Style.ChildBorderSize = backup_border_size;
54595459

54605460
ImGuiWindow* child_window = g.CurrentWindow;
@@ -5470,7 +5470,7 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b
54705470
const ImGuiID temp_id_for_activation = ImHashStr("##Child", 0, id);
54715471
if (g.ActiveId == temp_id_for_activation)
54725472
ClearActiveID();
5473-
if (g.NavActivateId == id && !(flags & ImGuiWindowFlags_NavFlattened) && (child_window->DC.NavLayersActiveMask != 0 || child_window->DC.NavWindowHasScrollY))
5473+
if (g.NavActivateId == id && !(window_flags & ImGuiWindowFlags_NavFlattened) && (child_window->DC.NavLayersActiveMask != 0 || child_window->DC.NavWindowHasScrollY))
54745474
{
54755475
FocusWindow(child_window);
54765476
NavInitWindow(child_window, false);

imgui.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ namespace ImGui
343343
// [Important: due to legacy reason, this is inconsistent with most other functions such as BeginMenu/EndMenu,
344344
// BeginPopup/EndPopup, etc. where the EndXXX call should only be called if the corresponding BeginXXX function
345345
// returned true. Begin and BeginChild are the only odd ones out. Will be fixed in a future update.]
346-
IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0, 0), bool border = false, ImGuiWindowFlags flags = 0);
347-
IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0, 0), bool border = false, ImGuiWindowFlags flags = 0);
346+
IMGUI_API bool BeginChild(const char* str_id, const ImVec2& size = ImVec2(0, 0), bool border = false, ImGuiWindowFlags window_flags = 0);
347+
IMGUI_API bool BeginChild(ImGuiID id, const ImVec2& size = ImVec2(0, 0), bool border = false, ImGuiWindowFlags window_flags = 0);
348348
IMGUI_API void EndChild();
349349

350350
// Windows Utilities

imgui_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3007,7 +3007,7 @@ namespace ImGui
30073007
IMGUI_API void LogSetNextTextDecoration(const char* prefix, const char* suffix);
30083008

30093009
// Popups, Modals, Tooltips
3010-
IMGUI_API bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags flags);
3010+
IMGUI_API bool BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags window_flags);
30113011
IMGUI_API void OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags = ImGuiPopupFlags_None);
30123012
IMGUI_API void ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_popup);
30133013
IMGUI_API void ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to_window_under_popup);

0 commit comments

Comments
 (0)