mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
BeginChild: (BREAKING) renamed ImGuiChildFlags_Border to ImGuiChildFlags_Borders.
Amend 7713c2925 + renamed similar argument in other functions.
This commit is contained in:
parent
1e939fcc32
commit
0b9adc2c79
7 changed files with 49 additions and 38 deletions
18
imgui.cpp
18
imgui.cpp
|
|
@ -430,6 +430,7 @@ CODE
|
|||
When you are not sure about an old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all imgui files.
|
||||
You can read releases logs https://github.com/ocornut/imgui/releases for more details.
|
||||
|
||||
- 2024/08/23 (1.91.1) - renamed ImGuiChildFlags_Border to ImGuiChildFlags_Borders for consistency. kept inline redirection flag.
|
||||
- 2024/08/22 (1.91.1) - moved some functions from ImGuiIO to ImGuiPlatformIO structure:
|
||||
- io.GetClipboardTextFn -> platform_io.Platform_GetClipboardTextFn + changed 'void* user_data' to 'ImGuiContext* ctx'. Pull your user data from platform_io.ClipboardUserData.
|
||||
- io.SetClipboardTextFn -> platform_io.Platform_SetClipboardTextFn + same as above line.
|
||||
|
|
@ -514,6 +515,7 @@ CODE
|
|||
- new: BeginChild("Name", size, ImGuiChildFlags_Border)
|
||||
- old: BeginChild("Name", size, false)
|
||||
- new: BeginChild("Name", size) or BeginChild("Name", 0) or BeginChild("Name", size, ImGuiChildFlags_None)
|
||||
**AMEND FROM THE FUTURE: from 1.91.1, 'ImGuiChildFlags_Border' is called 'ImGuiChildFlags_Borders'**
|
||||
- 2023/11/02 (1.90.0) - BeginChild: added child-flag ImGuiChildFlags_AlwaysUseWindowPadding as a replacement for the window-flag ImGuiWindowFlags_AlwaysUseWindowPadding: the feature only ever made sense for BeginChild() anyhow.
|
||||
- old: BeginChild("Name", size, 0, ImGuiWindowFlags_AlwaysUseWindowPadding);
|
||||
- new: BeginChild("Name", size, ImGuiChildFlags_AlwaysUseWindowPadding, 0);
|
||||
|
|
@ -3637,13 +3639,13 @@ void ImGui::RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, con
|
|||
}
|
||||
|
||||
// Render a rectangle shaped with optional rounding and borders
|
||||
void ImGui::RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border, float rounding)
|
||||
void ImGui::RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool borders, float rounding)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
window->DrawList->AddRectFilled(p_min, p_max, fill_col, rounding);
|
||||
const float border_size = g.Style.FrameBorderSize;
|
||||
if (border && border_size > 0.0f)
|
||||
if (borders && border_size > 0.0f)
|
||||
{
|
||||
window->DrawList->AddRect(p_min + ImVec2(1, 1), p_max + ImVec2(1, 1), GetColorU32(ImGuiCol_BorderShadow), rounding, 0, border_size);
|
||||
window->DrawList->AddRect(p_min, p_max, GetColorU32(ImGuiCol_Border), rounding, 0, border_size);
|
||||
|
|
@ -5623,7 +5625,7 @@ ImVec2 ImGui::GetItemRectSize()
|
|||
}
|
||||
|
||||
// Prior to v1.90 2023/10/16, the BeginChild() function took a 'bool border = false' parameter instead of 'ImGuiChildFlags child_flags = 0'.
|
||||
// ImGuiChildFlags_Border is defined as always == 1 in order to allow old code passing 'true'. Read comments in imgui.h for details!
|
||||
// ImGuiChildFlags_Borders is defined as always == 1 in order to allow old code passing 'true'. Read comments in imgui.h for details!
|
||||
bool ImGui::BeginChild(const char* str_id, const ImVec2& size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags)
|
||||
{
|
||||
ImGuiID id = GetCurrentWindow()->GetID(str_id);
|
||||
|
|
@ -5642,7 +5644,7 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, I
|
|||
IM_ASSERT(id != 0);
|
||||
|
||||
// Sanity check as it is likely that some user will accidentally pass ImGuiWindowFlags into the ImGuiChildFlags argument.
|
||||
const ImGuiChildFlags ImGuiChildFlags_SupportedMask_ = ImGuiChildFlags_Border | ImGuiChildFlags_AlwaysUseWindowPadding | ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY | ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY | ImGuiChildFlags_AlwaysAutoResize | ImGuiChildFlags_FrameStyle | ImGuiChildFlags_NavFlattened;
|
||||
const ImGuiChildFlags ImGuiChildFlags_SupportedMask_ = ImGuiChildFlags_Borders | ImGuiChildFlags_AlwaysUseWindowPadding | ImGuiChildFlags_ResizeX | ImGuiChildFlags_ResizeY | ImGuiChildFlags_AutoResizeX | ImGuiChildFlags_AutoResizeY | ImGuiChildFlags_AlwaysAutoResize | ImGuiChildFlags_FrameStyle | ImGuiChildFlags_NavFlattened;
|
||||
IM_UNUSED(ImGuiChildFlags_SupportedMask_);
|
||||
IM_ASSERT((child_flags & ~ImGuiChildFlags_SupportedMask_) == 0 && "Illegal ImGuiChildFlags value. Did you pass ImGuiWindowFlags values instead of ImGuiChildFlags?");
|
||||
IM_ASSERT((window_flags & ImGuiWindowFlags_AlwaysAutoResize) == 0 && "Cannot specify ImGuiWindowFlags_AlwaysAutoResize for BeginChild(). Use ImGuiChildFlags_AlwaysAutoResize!");
|
||||
|
|
@ -5677,7 +5679,7 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, I
|
|||
PushStyleVar(ImGuiStyleVar_ChildRounding, g.Style.FrameRounding);
|
||||
PushStyleVar(ImGuiStyleVar_ChildBorderSize, g.Style.FrameBorderSize);
|
||||
PushStyleVar(ImGuiStyleVar_WindowPadding, g.Style.FramePadding);
|
||||
child_flags |= ImGuiChildFlags_Border | ImGuiChildFlags_AlwaysUseWindowPadding;
|
||||
child_flags |= ImGuiChildFlags_Borders | ImGuiChildFlags_AlwaysUseWindowPadding;
|
||||
window_flags |= ImGuiWindowFlags_NoMove;
|
||||
}
|
||||
|
||||
|
|
@ -5707,7 +5709,7 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, I
|
|||
|
||||
// Set style
|
||||
const float backup_border_size = g.Style.ChildBorderSize;
|
||||
if ((child_flags & ImGuiChildFlags_Border) == 0)
|
||||
if ((child_flags & ImGuiChildFlags_Borders) == 0)
|
||||
g.Style.ChildBorderSize = 0.0f;
|
||||
|
||||
// Begin into window
|
||||
|
|
@ -15804,7 +15806,7 @@ void ImGui::DebugNodeWindow(ImGuiWindow* window, const char* label)
|
|||
(flags & ImGuiWindowFlags_NoMouseInputs)? "NoMouseInputs":"", (flags & ImGuiWindowFlags_NoNavInputs) ? "NoNavInputs" : "", (flags & ImGuiWindowFlags_AlwaysAutoResize) ? "AlwaysAutoResize" : "");
|
||||
if (flags & ImGuiWindowFlags_ChildWindow)
|
||||
BulletText("ChildFlags: 0x%08X (%s%s%s%s..)", window->ChildFlags,
|
||||
(window->ChildFlags & ImGuiChildFlags_Border) ? "Border " : "",
|
||||
(window->ChildFlags & ImGuiChildFlags_Borders) ? "Borders " : "",
|
||||
(window->ChildFlags & ImGuiChildFlags_ResizeX) ? "ResizeX " : "",
|
||||
(window->ChildFlags & ImGuiChildFlags_ResizeY) ? "ResizeY " : "",
|
||||
(window->ChildFlags & ImGuiChildFlags_NavFlattened) ? "NavFlattened " : "");
|
||||
|
|
@ -15983,7 +15985,7 @@ void ImGui::ShowDebugLogWindow(bool* p_open)
|
|||
EndPopup();
|
||||
}
|
||||
|
||||
BeginChild("##log", ImVec2(0.0f, 0.0f), ImGuiChildFlags_Border, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar);
|
||||
BeginChild("##log", ImVec2(0.0f, 0.0f), ImGuiChildFlags_Borders, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar);
|
||||
|
||||
const ImGuiDebugLogFlags backup_log_flags = g.DebugLogFlags;
|
||||
g.DebugLogFlags &= ~ImGuiDebugLogFlags_EventClipper;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue