|
@@ -6068,7 +6068,7 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, I
|
|
|
// A SetNextWindowSize() call always has priority (#8020)
|
|
|
// (since the code in Begin() never supported SizeVal==0.0f aka auto-resize via SetNextWindowSize() call, we don't support it here for now)
|
|
|
// FIXME: We only support ImGuiCond_Always in this path. Supporting other paths would requires to obtain window pointer.
|
|
|
- if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize) != 0 && (g.NextWindowData.SizeCond & ImGuiCond_Always) != 0)
|
|
|
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSize) != 0 && (g.NextWindowData.SizeCond & ImGuiCond_Always) != 0)
|
|
|
{
|
|
|
if (g.NextWindowData.SizeVal.x > 0.0f)
|
|
|
{
|
|
@@ -6084,11 +6084,11 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, I
|
|
|
SetNextWindowSize(size);
|
|
|
|
|
|
// Forward child flags (we allow prior settings to merge but it'll only work for adding flags)
|
|
|
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasChildFlags)
|
|
|
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasChildFlags)
|
|
|
g.NextWindowData.ChildFlags |= child_flags;
|
|
|
else
|
|
|
g.NextWindowData.ChildFlags = child_flags;
|
|
|
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasChildFlags;
|
|
|
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasChildFlags;
|
|
|
|
|
|
// Build up name. If you need to append to a same child from multiple location in the ID stack, use BeginChild(ImGuiID id) with a stable value.
|
|
|
// FIXME: 2023/11/14: commented out shorted version. We had an issue with multiple ### in child window path names, which the trailing hash helped workaround.
|
|
@@ -6302,7 +6302,7 @@ static ImVec2 CalcWindowSizeAfterConstraint(ImGuiWindow* window, const ImVec2& s
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
ImVec2 new_size = size_desired;
|
|
|
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSizeConstraint)
|
|
|
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSizeConstraint)
|
|
|
{
|
|
|
// See comments in SetNextWindowSizeConstraints() for details about setting size_min an size_max.
|
|
|
ImRect cr = g.NextWindowData.SizeConstraintRect;
|
|
@@ -6780,7 +6780,7 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
|
|
|
ImU32 bg_col = GetColorU32(GetWindowBgColorIdx(window));
|
|
|
bool override_alpha = false;
|
|
|
float alpha = 1.0f;
|
|
|
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasBgAlpha)
|
|
|
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasBgAlpha)
|
|
|
{
|
|
|
alpha = g.NextWindowData.BgAlphaVal;
|
|
|
override_alpha = true;
|
|
@@ -6950,7 +6950,7 @@ void ImGui::UpdateWindowSkipRefresh(ImGuiWindow* window)
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
window->SkipRefresh = false;
|
|
|
- if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasRefreshPolicy) == 0)
|
|
|
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasRefreshPolicy) == 0)
|
|
|
return;
|
|
|
if (g.NextWindowData.RefreshFlagsVal & ImGuiWindowRefreshFlags_TryToAvoidRefresh)
|
|
|
{
|
|
@@ -7031,7 +7031,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|
|
{
|
|
|
UpdateWindowInFocusOrderList(window, window_just_created, flags);
|
|
|
window->Flags = (ImGuiWindowFlags)flags;
|
|
|
- window->ChildFlags = (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasChildFlags) ? g.NextWindowData.ChildFlags : 0;
|
|
|
+ window->ChildFlags = (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasChildFlags) ? g.NextWindowData.ChildFlags : 0;
|
|
|
window->LastFrameActive = current_frame;
|
|
|
window->LastTimeActive = (float)g.Time;
|
|
|
window->BeginOrderWithinParent = 0;
|
|
@@ -7095,7 +7095,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|
|
// (FIXME: Consider splitting the HasXXX flags into X/Y components
|
|
|
bool window_pos_set_by_api = false;
|
|
|
bool window_size_x_set_by_api = false, window_size_y_set_by_api = false;
|
|
|
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasPos)
|
|
|
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasPos)
|
|
|
{
|
|
|
window_pos_set_by_api = (window->SetWindowPosAllowFlags & g.NextWindowData.PosCond) != 0;
|
|
|
if (window_pos_set_by_api && ImLengthSqr(g.NextWindowData.PosPivotVal) > 0.00001f)
|
|
@@ -7111,7 +7111,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|
|
SetWindowPos(window, g.NextWindowData.PosVal, g.NextWindowData.PosCond);
|
|
|
}
|
|
|
}
|
|
|
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize)
|
|
|
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSize)
|
|
|
{
|
|
|
window_size_x_set_by_api = (window->SetWindowSizeAllowFlags & g.NextWindowData.SizeCond) != 0 && (g.NextWindowData.SizeVal.x > 0.0f);
|
|
|
window_size_y_set_by_api = (window->SetWindowSizeAllowFlags & g.NextWindowData.SizeCond) != 0 && (g.NextWindowData.SizeVal.y > 0.0f);
|
|
@@ -7121,7 +7121,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|
|
g.NextWindowData.SizeVal.y = window->SizeFull.y;
|
|
|
SetWindowSize(window, g.NextWindowData.SizeVal, g.NextWindowData.SizeCond);
|
|
|
}
|
|
|
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasScroll)
|
|
|
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasScroll)
|
|
|
{
|
|
|
if (g.NextWindowData.ScrollVal.x >= 0.0f)
|
|
|
{
|
|
@@ -7134,13 +7134,13 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
|
|
window->ScrollTargetCenterRatio.y = 0.0f;
|
|
|
}
|
|
|
}
|
|
|
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasContentSize)
|
|
|
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasContentSize)
|
|
|
window->ContentSizeExplicit = g.NextWindowData.ContentSizeVal;
|
|
|
else if (first_begin_of_the_frame)
|
|
|
window->ContentSizeExplicit = ImVec2(0.0f, 0.0f);
|
|
|
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasCollapsed)
|
|
|
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasCollapsed)
|
|
|
SetWindowCollapsed(window, g.NextWindowData.CollapsedVal, g.NextWindowData.CollapsedCond);
|
|
|
- if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasFocus)
|
|
|
+ if (g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasFocus)
|
|
|
FocusWindow(window);
|
|
|
if (window->Appearing)
|
|
|
SetWindowConditionAllowFlags(window, ImGuiCond_Appearing, false);
|
|
@@ -8223,7 +8223,7 @@ void ImGui::SetNextWindowPos(const ImVec2& pos, ImGuiCond cond, const ImVec2& pi
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags.
|
|
|
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasPos;
|
|
|
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasPos;
|
|
|
g.NextWindowData.PosVal = pos;
|
|
|
g.NextWindowData.PosPivotVal = pivot;
|
|
|
g.NextWindowData.PosCond = cond ? cond : ImGuiCond_Always;
|
|
@@ -8233,7 +8233,7 @@ void ImGui::SetNextWindowSize(const ImVec2& size, ImGuiCond cond)
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags.
|
|
|
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasSize;
|
|
|
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasSize;
|
|
|
g.NextWindowData.SizeVal = size;
|
|
|
g.NextWindowData.SizeCond = cond ? cond : ImGuiCond_Always;
|
|
|
}
|
|
@@ -8245,7 +8245,7 @@ void ImGui::SetNextWindowSize(const ImVec2& size, ImGuiCond cond)
|
|
|
void ImGui::SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback, void* custom_callback_user_data)
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasSizeConstraint;
|
|
|
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasSizeConstraint;
|
|
|
g.NextWindowData.SizeConstraintRect = ImRect(size_min, size_max);
|
|
|
g.NextWindowData.SizeCallback = custom_callback;
|
|
|
g.NextWindowData.SizeCallbackUserData = custom_callback_user_data;
|
|
@@ -8256,14 +8256,14 @@ void ImGui::SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& s
|
|
|
void ImGui::SetNextWindowContentSize(const ImVec2& size)
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasContentSize;
|
|
|
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasContentSize;
|
|
|
g.NextWindowData.ContentSizeVal = ImTrunc(size);
|
|
|
}
|
|
|
|
|
|
void ImGui::SetNextWindowScroll(const ImVec2& scroll)
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasScroll;
|
|
|
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasScroll;
|
|
|
g.NextWindowData.ScrollVal = scroll;
|
|
|
}
|
|
|
|
|
@@ -8271,7 +8271,7 @@ void ImGui::SetNextWindowCollapsed(bool collapsed, ImGuiCond cond)
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
IM_ASSERT(cond == 0 || ImIsPowerOfTwo(cond)); // Make sure the user doesn't attempt to combine multiple condition flags.
|
|
|
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasCollapsed;
|
|
|
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasCollapsed;
|
|
|
g.NextWindowData.CollapsedVal = collapsed;
|
|
|
g.NextWindowData.CollapsedCond = cond ? cond : ImGuiCond_Always;
|
|
|
}
|
|
@@ -8279,7 +8279,7 @@ void ImGui::SetNextWindowCollapsed(bool collapsed, ImGuiCond cond)
|
|
|
void ImGui::SetNextWindowBgAlpha(float alpha)
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasBgAlpha;
|
|
|
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasBgAlpha;
|
|
|
g.NextWindowData.BgAlphaVal = alpha;
|
|
|
}
|
|
|
|
|
@@ -8287,7 +8287,7 @@ void ImGui::SetNextWindowBgAlpha(float alpha)
|
|
|
void ImGui::SetNextWindowRefreshPolicy(ImGuiWindowRefreshFlags flags)
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasRefreshPolicy;
|
|
|
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasRefreshPolicy;
|
|
|
g.NextWindowData.RefreshFlagsVal = flags;
|
|
|
}
|
|
|
|
|
@@ -11301,7 +11301,7 @@ bool ImGui::BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags ext
|
|
|
// See FindBestWindowPosForPopup() for positionning logic of other tooltips (not drag and drop ones).
|
|
|
//ImVec2 tooltip_pos = g.IO.MousePos - g.ActiveIdClickOffset - g.Style.WindowPadding;
|
|
|
const bool is_touchscreen = (g.IO.MouseSource == ImGuiMouseSource_TouchScreen);
|
|
|
- if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasPos) == 0)
|
|
|
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasPos) == 0)
|
|
|
{
|
|
|
ImVec2 tooltip_pos = is_touchscreen ? (g.IO.MousePos + TOOLTIP_DEFAULT_OFFSET_TOUCH * g.Style.MouseCursorScale) : (g.IO.MousePos + TOOLTIP_DEFAULT_OFFSET_MOUSE * g.Style.MouseCursorScale);
|
|
|
ImVec2 tooltip_pivot = is_touchscreen ? TOOLTIP_DEFAULT_PIVOT_TOUCH : ImVec2(0.0f, 0.0f);
|
|
@@ -11724,7 +11724,7 @@ bool ImGui::BeginPopupModal(const char* name, bool* p_open, ImGuiWindowFlags fla
|
|
|
// Center modal windows by default for increased visibility
|
|
|
// (this won't really last as settings will kick in, and is mostly for backward compatibility. user may do the same themselves)
|
|
|
// FIXME: Should test for (PosCond & window->SetWindowPosAllowFlags) with the upcoming window.
|
|
|
- if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasPos) == 0)
|
|
|
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasPos) == 0)
|
|
|
{
|
|
|
const ImGuiViewport* viewport = GetMainViewport();
|
|
|
SetNextWindowPos(viewport->GetCenter(), ImGuiCond_FirstUseEver, ImVec2(0.5f, 0.5f));
|
|
@@ -12017,7 +12017,7 @@ void ImGui::SetWindowFocus(const char* name)
|
|
|
void ImGui::SetNextWindowFocus()
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
- g.NextWindowData.Flags |= ImGuiNextWindowDataFlags_HasFocus;
|
|
|
+ g.NextWindowData.HasFlags |= ImGuiNextWindowDataFlags_HasFocus;
|
|
|
}
|
|
|
|
|
|
// Similar to IsWindowHovered()
|
|
@@ -16548,7 +16548,7 @@ static void ShowDebugLogFlag(const char* name, ImGuiDebugLogFlags flags)
|
|
|
void ImGui::ShowDebugLogWindow(bool* p_open)
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
- if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize) == 0)
|
|
|
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSize) == 0)
|
|
|
SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 12.0f), ImGuiCond_FirstUseEver);
|
|
|
if (!Begin("Dear ImGui Debug Log", p_open) || GetCurrentWindow()->BeginCount > 1)
|
|
|
{
|
|
@@ -16868,7 +16868,7 @@ static int StackToolFormatLevelInfo(ImGuiIDStackTool* tool, int n, bool format_f
|
|
|
void ImGui::ShowIDStackToolWindow(bool* p_open)
|
|
|
{
|
|
|
ImGuiContext& g = *GImGui;
|
|
|
- if ((g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize) == 0)
|
|
|
+ if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSize) == 0)
|
|
|
SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 8.0f), ImGuiCond_FirstUseEver);
|
|
|
if (!Begin("Dear ImGui ID Stack Tool", p_open) || GetCurrentWindow()->BeginCount > 1)
|
|
|
{
|