Updated ImGui.
This commit is contained in:
parent
e1af4e6d85
commit
6163faadf6
79
3rdparty/dear-imgui/imgui.cpp
vendored
79
3rdparty/dear-imgui/imgui.cpp
vendored
@ -1022,6 +1022,8 @@ CODE
|
||||
#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double.
|
||||
#endif
|
||||
#elif defined(__GNUC__)
|
||||
// We disable -Wpragmas because GCC doesn't provide an has_warning equivalent and some forks/patches may not following the warning/version association.
|
||||
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
|
||||
#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
|
||||
#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
|
||||
#pragma GCC diagnostic ignored "-Wformat" // warning: format '%p' expects argument of type 'void*', but argument 6 has type 'ImGuiWindow*'
|
||||
@ -1029,9 +1031,7 @@ CODE
|
||||
#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked
|
||||
#pragma GCC diagnostic ignored "-Wstrict-overflow" // warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false
|
||||
#if __GNUC__ >= 8
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess" // warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
|
||||
#endif
|
||||
|
||||
// When using CTRL+TAB (or Gamepad Square+L/R) we delay the visual a little in order to reduce visual noise doing a fast switch.
|
||||
@ -2251,8 +2251,8 @@ static void SetCursorPosYAndSetupDummyPrevLine(float pos_y, float line_height)
|
||||
ImGuiWindow* window = ImGui::GetCurrentWindow();
|
||||
window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y - line_height; // Setting those fields so that SetScrollHereY() can properly function after the end of our clipper usage.
|
||||
window->DC.PrevLineSize.y = (line_height - GImGui->Style.ItemSpacing.y); // If we end up needing more accurate data (to e.g. use SameLine) we may as well make the clipper have a fourth step to let user process and display the last item in their list.
|
||||
if (window->DC.CurrentColumns)
|
||||
window->DC.CurrentColumns->LineMinY = window->DC.CursorPos.y; // Setting this so that cell Y position are set properly
|
||||
if (ImGuiColumns* columns = window->DC.CurrentColumns)
|
||||
columns->LineMinY = window->DC.CursorPos.y; // Setting this so that cell Y position are set properly
|
||||
}
|
||||
|
||||
// Use case A: Begin() called from constructor with items_height<0, then called again from Sync() in StepNo 1
|
||||
@ -3300,7 +3300,7 @@ void ImGui::UpdateMouseMovingWindowEndFrame()
|
||||
if (!g.HoveredRootWindow->TitleBarRect().Contains(g.IO.MouseClickedPos[0]))
|
||||
g.MovingWindow = NULL;
|
||||
}
|
||||
else if (g.NavWindow != NULL && GetFrontMostPopupModal() == NULL)
|
||||
else if (g.NavWindow != NULL && GetTopMostPopupModal() == NULL)
|
||||
{
|
||||
// Clicking on void disable focus
|
||||
FocusWindow(NULL);
|
||||
@ -3312,9 +3312,9 @@ void ImGui::UpdateMouseMovingWindowEndFrame()
|
||||
// (The left mouse button path calls FocusWindow on the hovered window, which will lead NewFrame->ClosePopupsOverWindow to trigger)
|
||||
if (g.IO.MouseClicked[1])
|
||||
{
|
||||
// Find the top-most window between HoveredWindow and the front most Modal Window.
|
||||
// Find the top-most window between HoveredWindow and the top-most Modal Window.
|
||||
// This is where we can trim the popup stack.
|
||||
ImGuiWindow* modal = GetFrontMostPopupModal();
|
||||
ImGuiWindow* modal = GetTopMostPopupModal();
|
||||
bool hovered_window_above_modal = false;
|
||||
if (modal == NULL)
|
||||
hovered_window_above_modal = true;
|
||||
@ -3425,7 +3425,7 @@ void ImGui::UpdateMouseWheel()
|
||||
const bool scroll_allowed = !(window->Flags & ImGuiWindowFlags_NoScrollWithMouse) && !(window->Flags & ImGuiWindowFlags_NoMouseInputs);
|
||||
if (scroll_allowed && (g.IO.MouseWheel != 0.0f || g.IO.MouseWheelH != 0.0f) && !g.IO.KeyCtrl)
|
||||
{
|
||||
ImVec2 max_step = (window->ContentsRegionRect.GetSize() + window->WindowPadding * 2.0f) * 0.67f;
|
||||
ImVec2 max_step = window->InnerRect.GetSize() * 0.67f;
|
||||
|
||||
// Vertical Mouse Wheel Scrolling (hold Shift to scroll horizontally)
|
||||
if (g.IO.MouseWheel != 0.0f && !g.IO.KeyShift)
|
||||
@ -3460,7 +3460,7 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags()
|
||||
FindHoveredWindow();
|
||||
|
||||
// Modal windows prevents cursor from hovering behind them.
|
||||
ImGuiWindow* modal_window = GetFrontMostPopupModal();
|
||||
ImGuiWindow* modal_window = GetTopMostPopupModal();
|
||||
if (modal_window)
|
||||
if (g.HoveredRootWindow && !IsWindowChildOf(g.HoveredRootWindow, modal_window))
|
||||
g.HoveredRootWindow = g.HoveredWindow = NULL;
|
||||
@ -3656,7 +3656,7 @@ void ImGui::NewFrame()
|
||||
UpdateMouseMovingWindowNewFrame();
|
||||
|
||||
// Background darkening/whitening
|
||||
if (GetFrontMostPopupModal() != NULL || (g.NavWindowingTarget != NULL && g.NavWindowingHighlightAlpha > 0.0f))
|
||||
if (GetTopMostPopupModal() != NULL || (g.NavWindowingTarget != NULL && g.NavWindowingHighlightAlpha > 0.0f))
|
||||
g.DimBgRatio = ImMin(g.DimBgRatio + g.IO.DeltaTime * 6.0f, 1.0f);
|
||||
else
|
||||
g.DimBgRatio = ImMax(g.DimBgRatio - g.IO.DeltaTime * 10.0f, 0.0f);
|
||||
@ -4064,18 +4064,18 @@ void ImGui::Render()
|
||||
if (!g.BackgroundDrawList.VtxBuffer.empty())
|
||||
AddDrawListToDrawData(&g.DrawDataBuilder.Layers[0], &g.BackgroundDrawList);
|
||||
|
||||
ImGuiWindow* windows_to_render_front_most[2];
|
||||
windows_to_render_front_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL;
|
||||
windows_to_render_front_most[1] = g.NavWindowingTarget ? g.NavWindowingList : NULL;
|
||||
ImGuiWindow* windows_to_render_top_most[2];
|
||||
windows_to_render_top_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL;
|
||||
windows_to_render_top_most[1] = g.NavWindowingTarget ? g.NavWindowingList : NULL;
|
||||
for (int n = 0; n != g.Windows.Size; n++)
|
||||
{
|
||||
ImGuiWindow* window = g.Windows[n];
|
||||
if (IsWindowActiveAndVisible(window) && (window->Flags & ImGuiWindowFlags_ChildWindow) == 0 && window != windows_to_render_front_most[0] && window != windows_to_render_front_most[1])
|
||||
if (IsWindowActiveAndVisible(window) && (window->Flags & ImGuiWindowFlags_ChildWindow) == 0 && window != windows_to_render_top_most[0] && window != windows_to_render_top_most[1])
|
||||
AddRootWindowToDrawData(window);
|
||||
}
|
||||
for (int n = 0; n < IM_ARRAYSIZE(windows_to_render_front_most); n++)
|
||||
if (windows_to_render_front_most[n] && IsWindowActiveAndVisible(windows_to_render_front_most[n])) // NavWindowingTarget is always temporarily displayed as the front-most window
|
||||
AddRootWindowToDrawData(windows_to_render_front_most[n]);
|
||||
for (int n = 0; n < IM_ARRAYSIZE(windows_to_render_top_most); n++)
|
||||
if (windows_to_render_top_most[n] && IsWindowActiveAndVisible(windows_to_render_top_most[n])) // NavWindowingTarget is always temporarily displayed as the top-most window
|
||||
AddRootWindowToDrawData(windows_to_render_top_most[n]);
|
||||
g.DrawDataBuilder.FlattenIntoSingleLayer();
|
||||
|
||||
// Draw software mouse cursor if requested
|
||||
@ -5620,7 +5620,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
float top_border_size = (((flags & ImGuiWindowFlags_MenuBar) || !(flags & ImGuiWindowFlags_NoTitleBar)) ? style.FrameBorderSize : window->WindowBorderSize);
|
||||
window->InnerClipRect.Min.x = ImFloor(0.5f + window->InnerRect.Min.x + ImMax(ImFloor(window->WindowPadding.x * 0.5f), window->WindowBorderSize));
|
||||
window->InnerClipRect.Min.y = ImFloor(0.5f + window->InnerRect.Min.y + top_border_size);
|
||||
window->InnerClipRect.Max.x = ImFloor(0.5f + window->InnerRect.Max.x - ImMax(ImFloor(window->WindowPadding.y * 0.5f), window->WindowBorderSize));
|
||||
window->InnerClipRect.Max.x = ImFloor(0.5f + window->InnerRect.Max.x - ImMax(ImFloor(window->WindowPadding.x * 0.5f), window->WindowBorderSize));
|
||||
window->InnerClipRect.Max.y = ImFloor(0.5f + window->InnerRect.Max.y - window->WindowBorderSize);
|
||||
window->InnerClipRect.ClipWithFull(host_rect);
|
||||
|
||||
@ -5650,7 +5650,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
PushClipRect(host_rect.Min, host_rect.Max, false);
|
||||
|
||||
// Draw modal window background (darkens what is behind them, all viewports)
|
||||
const bool dim_bg_for_modal = (flags & ImGuiWindowFlags_Modal) && window == GetFrontMostPopupModal() && window->HiddenFramesCannotSkipItems <= 0;
|
||||
const bool dim_bg_for_modal = (flags & ImGuiWindowFlags_Modal) && window == GetTopMostPopupModal() && window->HiddenFramesCannotSkipItems <= 0;
|
||||
const bool dim_bg_for_window_list = g.NavWindowingTargetAnim && (window == g.NavWindowingTargetAnim->RootWindow);
|
||||
if (dim_bg_for_modal || dim_bg_for_window_list)
|
||||
{
|
||||
@ -5874,7 +5874,7 @@ void ImGui::End()
|
||||
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
|
||||
if (window->DC.CurrentColumns != NULL)
|
||||
if (window->DC.CurrentColumns)
|
||||
EndColumns();
|
||||
PopClipRect(); // Inner window clip rectangle
|
||||
|
||||
@ -5895,7 +5895,7 @@ void ImGui::BringWindowToFocusFront(ImGuiWindow* window)
|
||||
ImGuiContext& g = *GImGui;
|
||||
if (g.WindowsFocusOrder.back() == window)
|
||||
return;
|
||||
for (int i = g.WindowsFocusOrder.Size - 2; i >= 0; i--) // We can ignore the front most window
|
||||
for (int i = g.WindowsFocusOrder.Size - 2; i >= 0; i--) // We can ignore the top-most window
|
||||
if (g.WindowsFocusOrder[i] == window)
|
||||
{
|
||||
memmove(&g.WindowsFocusOrder[i], &g.WindowsFocusOrder[i + 1], (size_t)(g.WindowsFocusOrder.Size - i - 1) * sizeof(ImGuiWindow*));
|
||||
@ -5910,7 +5910,7 @@ void ImGui::BringWindowToDisplayFront(ImGuiWindow* window)
|
||||
ImGuiWindow* current_front_window = g.Windows.back();
|
||||
if (current_front_window == window || current_front_window->RootWindow == window)
|
||||
return;
|
||||
for (int i = g.Windows.Size - 2; i >= 0; i--) // We can ignore the front most window
|
||||
for (int i = g.Windows.Size - 2; i >= 0; i--) // We can ignore the top-most window
|
||||
if (g.Windows[i] == window)
|
||||
{
|
||||
memmove(&g.Windows[i], &g.Windows[i + 1], (size_t)(g.Windows.Size - i - 1) * sizeof(ImGuiWindow*));
|
||||
@ -6651,7 +6651,7 @@ ImVec2 ImGui::GetContentRegionMax()
|
||||
ImGuiWindow* window = GImGui->CurrentWindow;
|
||||
ImVec2 mx = window->ContentsRegionRect.Max - window->Pos;
|
||||
if (window->DC.CurrentColumns)
|
||||
mx.x = GetColumnOffset(window->DC.CurrentColumns->Current + 1) - window->WindowPadding.x;
|
||||
mx.x = window->WorkRect.Max.x - window->Pos.x;
|
||||
return mx;
|
||||
}
|
||||
|
||||
@ -6661,7 +6661,7 @@ ImVec2 ImGui::GetContentRegionMaxAbs()
|
||||
ImGuiWindow* window = GImGui->CurrentWindow;
|
||||
ImVec2 mx = window->ContentsRegionRect.Max;
|
||||
if (window->DC.CurrentColumns)
|
||||
mx.x = window->Pos.x + GetColumnOffset(window->DC.CurrentColumns->Current + 1) - window->WindowPadding.x;
|
||||
mx.x = window->WorkRect.Max.x;
|
||||
return mx;
|
||||
}
|
||||
|
||||
@ -6674,19 +6674,19 @@ ImVec2 ImGui::GetContentRegionAvail()
|
||||
// In window space (not screen space!)
|
||||
ImVec2 ImGui::GetWindowContentRegionMin()
|
||||
{
|
||||
ImGuiWindow* window = GetCurrentWindowRead();
|
||||
ImGuiWindow* window = GImGui->CurrentWindow;
|
||||
return window->ContentsRegionRect.Min - window->Pos;
|
||||
}
|
||||
|
||||
ImVec2 ImGui::GetWindowContentRegionMax()
|
||||
{
|
||||
ImGuiWindow* window = GetCurrentWindowRead();
|
||||
ImGuiWindow* window = GImGui->CurrentWindow;
|
||||
return window->ContentsRegionRect.Max - window->Pos;
|
||||
}
|
||||
|
||||
float ImGui::GetWindowContentRegionWidth()
|
||||
{
|
||||
ImGuiWindow* window = GetCurrentWindowRead();
|
||||
ImGuiWindow* window = GImGui->CurrentWindow;
|
||||
return window->ContentsRegionRect.GetWidth();
|
||||
}
|
||||
|
||||
@ -7180,7 +7180,7 @@ bool ImGui::IsPopupOpen(const char* str_id)
|
||||
return g.OpenPopupStack.Size > g.BeginPopupStack.Size && g.OpenPopupStack[g.BeginPopupStack.Size].PopupId == g.CurrentWindow->GetID(str_id);
|
||||
}
|
||||
|
||||
ImGuiWindow* ImGui::GetFrontMostPopupModal()
|
||||
ImGuiWindow* ImGui::GetTopMostPopupModal()
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
for (int n = g.OpenPopupStack.Size-1; n >= 0; n--)
|
||||
@ -8437,7 +8437,7 @@ static void ImGui::NavUpdateWindowing()
|
||||
ImGuiWindow* apply_focus_window = NULL;
|
||||
bool apply_toggle_layer = false;
|
||||
|
||||
ImGuiWindow* modal_window = GetFrontMostPopupModal();
|
||||
ImGuiWindow* modal_window = GetTopMostPopupModal();
|
||||
if (modal_window != NULL)
|
||||
{
|
||||
g.NavWindowingTarget = NULL;
|
||||
@ -8479,7 +8479,7 @@ static void ImGui::NavUpdateWindowing()
|
||||
g.NavWindowingHighlightAlpha = 1.0f;
|
||||
}
|
||||
|
||||
// Single press toggles NavLayer, long press with L/R apply actual focus on release (until then the window was merely rendered front-most)
|
||||
// Single press toggles NavLayer, long press with L/R apply actual focus on release (until then the window was merely rendered top-most)
|
||||
if (!IsNavInputDown(ImGuiNavInput_Menu))
|
||||
{
|
||||
g.NavWindowingToggleLayer &= (g.NavWindowingHighlightAlpha < 1.0f); // Once button was held long enough we don't consider it a tap-to-toggle-layer press anymore.
|
||||
@ -8657,7 +8657,13 @@ void ImGui::NextColumn()
|
||||
window->DC.CurrLineTextBaseOffset = 0.0f;
|
||||
|
||||
PushColumnClipRect(columns->Current); // FIXME-COLUMNS: Could it be an overwrite?
|
||||
PushItemWidth(GetColumnWidth() * 0.65f); // FIXME-COLUMNS: Move on columns setup
|
||||
|
||||
// FIXME-COLUMNS: Share code with BeginColumns() - move code on columns setup.
|
||||
float offset_0 = GetColumnOffset(columns->Current);
|
||||
float offset_1 = GetColumnOffset(columns->Current + 1);
|
||||
float width = offset_1 - offset_0;
|
||||
PushItemWidth(width * 0.65f);
|
||||
window->WorkRect.Max.x = window->Pos.x + offset_1 - window->WindowPadding.x;
|
||||
}
|
||||
|
||||
int ImGui::GetColumnIndex()
|
||||
@ -8853,6 +8859,7 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiColumnsFlag
|
||||
columns->HostCursorPosY = window->DC.CursorPos.y;
|
||||
columns->HostCursorMaxPosX = window->DC.CursorMaxPos.x;
|
||||
columns->HostClipRect = window->ClipRect;
|
||||
columns->HostWorkRect = window->WorkRect;
|
||||
columns->LineMinY = columns->LineMaxY = window->DC.CursorPos.y;
|
||||
window->DC.ColumnsOffset.x = 0.0f;
|
||||
window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
|
||||
@ -8890,7 +8897,12 @@ void ImGui::BeginColumns(const char* str_id, int columns_count, ImGuiColumnsFlag
|
||||
window->DrawList->ChannelsSetCurrent(1);
|
||||
PushColumnClipRect(0);
|
||||
}
|
||||
PushItemWidth(GetColumnWidth() * 0.65f);
|
||||
|
||||
float offset_0 = GetColumnOffset(columns->Current);
|
||||
float offset_1 = GetColumnOffset(columns->Current + 1);
|
||||
float width = offset_1 - offset_0;
|
||||
PushItemWidth(width * 0.65f);
|
||||
window->WorkRect.Max.x = window->Pos.x + offset_1 - window->WindowPadding.x;
|
||||
}
|
||||
|
||||
void ImGui::EndColumns()
|
||||
@ -8962,6 +8974,7 @@ void ImGui::EndColumns()
|
||||
}
|
||||
columns->IsBeingResized = is_being_resized;
|
||||
|
||||
window->WorkRect = columns->HostWorkRect;
|
||||
window->DC.CurrentColumns = NULL;
|
||||
window->DC.ColumnsOffset.x = 0.0f;
|
||||
window->DC.CursorPos.x = (float)(int)(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
|
||||
|
15
3rdparty/dear-imgui/imgui.h
vendored
15
3rdparty/dear-imgui/imgui.h
vendored
@ -1,4 +1,4 @@
|
||||
// dear imgui, v1.71 WIP
|
||||
// dear imgui, v1.72 WIP
|
||||
// (headers)
|
||||
|
||||
// See imgui.cpp file for documentation.
|
||||
@ -84,9 +84,10 @@ Index of this file:
|
||||
#if __has_warning("-Wzero-as-null-pointer-constant")
|
||||
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
|
||||
#endif
|
||||
#elif defined(__GNUC__) && __GNUC__ >= 8
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -275,17 +276,17 @@ namespace ImGui
|
||||
IMGUI_API void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback = NULL, void* custom_callback_data = NULL); // set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Sizes will be rounded down. Use callback to apply non-trivial programmatic constraints.
|
||||
IMGUI_API void SetNextWindowContentSize(const ImVec2& size); // set next window content size (~ scrollable client area, which enforce the range of scrollbars). Not including window decorations (title bar, menu bar, etc.) nor WindowPadding. set an axis to 0.0f to leave it automatic. call before Begin()
|
||||
IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // set next window collapsed state. call before Begin()
|
||||
IMGUI_API void SetNextWindowFocus(); // set next window to be focused / front-most. call before Begin()
|
||||
IMGUI_API void SetNextWindowFocus(); // set next window to be focused / top-most. call before Begin()
|
||||
IMGUI_API void SetNextWindowBgAlpha(float alpha); // set next window background color alpha. helper to easily modify ImGuiCol_WindowBg/ChildBg/PopupBg. you may also use ImGuiWindowFlags_NoBackground.
|
||||
IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiCond cond = 0); // (not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects.
|
||||
IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiCond cond = 0); // (not recommended) set current window size - call within Begin()/End(). set to ImVec2(0,0) to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects.
|
||||
IMGUI_API void SetWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // (not recommended) set current window collapsed state. prefer using SetNextWindowCollapsed().
|
||||
IMGUI_API void SetWindowFocus(); // (not recommended) set current window to be focused / front-most. prefer using SetNextWindowFocus().
|
||||
IMGUI_API void SetWindowFocus(); // (not recommended) set current window to be focused / top-most. prefer using SetNextWindowFocus().
|
||||
IMGUI_API void SetWindowFontScale(float scale); // set font scale. Adjust IO.FontGlobalScale if you want to scale all windows
|
||||
IMGUI_API void SetWindowPos(const char* name, const ImVec2& pos, ImGuiCond cond = 0); // set named window position.
|
||||
IMGUI_API void SetWindowSize(const char* name, const ImVec2& size, ImGuiCond cond = 0); // set named window size. set axis to 0.0f to force an auto-fit on this axis.
|
||||
IMGUI_API void SetWindowCollapsed(const char* name, bool collapsed, ImGuiCond cond = 0); // set named window collapsed state
|
||||
IMGUI_API void SetWindowFocus(const char* name); // set named window to be focused / front-most. use NULL to remove focus.
|
||||
IMGUI_API void SetWindowFocus(const char* name); // set named window to be focused / top-most. use NULL to remove focus.
|
||||
|
||||
// Content region
|
||||
// - Those functions are bound to be redesigned soon (they are confusing, incomplete and return values in local window coordinates which increases confusion)
|
||||
@ -2202,7 +2203,7 @@ struct ImFont
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(__GNUC__) && __GNUC__ >= 8
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
|
5
3rdparty/dear-imgui/imgui_demo.cpp
vendored
5
3rdparty/dear-imgui/imgui_demo.cpp
vendored
@ -89,13 +89,12 @@ Index of this file:
|
||||
#pragma clang diagnostic ignored "-Wreserved-id-macro" // warning : macro name is a reserved identifier //
|
||||
#endif
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
|
||||
#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
|
||||
#pragma GCC diagnostic ignored "-Wformat-security" // warning : format string is not a string literal (potentially insecure)
|
||||
#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
|
||||
#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
|
||||
#if (__GNUC__ >= 6)
|
||||
#pragma GCC diagnostic ignored "-Wmisleading-indentation" // warning: this 'if' clause does not guard this statement // GCC 6.0+ only. See #883 on GitHub.
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Wmisleading-indentation" // [__GNUC__ >= 6] warning: this 'if' clause does not guard this statement // GCC 6.0+ only. See #883 on GitHub.
|
||||
#endif
|
||||
|
||||
// Play it nice with Windows users. Notepad in 2017 still doesn't display text data with Unix-style \n.
|
||||
|
11
3rdparty/dear-imgui/imgui_draw.cpp
vendored
11
3rdparty/dear-imgui/imgui_draw.cpp
vendored
@ -72,13 +72,12 @@ Index of this file:
|
||||
#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double.
|
||||
#endif
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
|
||||
#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
|
||||
#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
|
||||
#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
|
||||
#pragma GCC diagnostic ignored "-Wstack-protector" // warning: stack protector not protecting local variables: variable length buffer
|
||||
#if __GNUC__ >= 8
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess" // warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
@ -365,7 +364,7 @@ void ImDrawList::Clear()
|
||||
CmdBuffer.resize(0);
|
||||
IdxBuffer.resize(0);
|
||||
VtxBuffer.resize(0);
|
||||
Flags = _Data->InitialFlags;
|
||||
Flags = _Data ? _Data->InitialFlags : ImDrawListFlags_None;
|
||||
_VtxCurrentOffset = 0;
|
||||
_VtxCurrentIdx = 0;
|
||||
_VtxWritePtr = NULL;
|
||||
@ -392,7 +391,7 @@ void ImDrawList::ClearFreeMemory()
|
||||
|
||||
ImDrawList* ImDrawList::CloneOutput() const
|
||||
{
|
||||
ImDrawList* dst = IM_NEW(ImDrawList(NULL));
|
||||
ImDrawList* dst = IM_NEW(ImDrawList(_Data));
|
||||
dst->CmdBuffer = CmdBuffer;
|
||||
dst->IdxBuffer = IdxBuffer;
|
||||
dst->VtxBuffer = VtxBuffer;
|
||||
@ -2693,7 +2692,7 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
|
||||
}
|
||||
|
||||
// We ignore blank width at the end of the line (they can be skipped)
|
||||
if (line_width + word_width >= wrap_width)
|
||||
if (line_width + word_width > wrap_width)
|
||||
{
|
||||
// Words that cannot possibly fit within an entire line will be cut anywhere.
|
||||
if (word_width < wrap_width)
|
||||
|
12
3rdparty/dear-imgui/imgui_internal.h
vendored
12
3rdparty/dear-imgui/imgui_internal.h
vendored
@ -56,9 +56,8 @@ Index of this file:
|
||||
#endif
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#if __GNUC__ >= 8
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess" // warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -704,6 +703,7 @@ struct ImGuiColumns
|
||||
float HostCursorPosY; // Backup of CursorPos at the time of BeginColumns()
|
||||
float HostCursorMaxPosX; // Backup of CursorMaxPos at the time of BeginColumns()
|
||||
ImRect HostClipRect; // Backup of ClipRect at the time of BeginColumns()
|
||||
ImRect HostWorkRect; // Backup of WorkRect at the time of BeginColumns()
|
||||
ImVector<ImGuiColumnData> Columns;
|
||||
|
||||
ImGuiColumns() { Clear(); }
|
||||
@ -919,7 +919,7 @@ struct ImGuiContext
|
||||
ImGuiInputSource NavInputSource; // Keyboard or Gamepad mode? THIS WILL ONLY BE None or NavGamepad or NavKeyboard.
|
||||
ImRect NavScoringRectScreen; // Rectangle used for scoring, in screen space. Based of window->DC.NavRefRectRel[], modified for directional navigation scoring.
|
||||
int NavScoringCount; // Metrics for debugging
|
||||
ImGuiWindow* NavWindowingTarget; // When selecting a window (holding Menu+FocusPrev/Next, or equivalent of CTRL-TAB) this window is temporarily displayed front-most.
|
||||
ImGuiWindow* NavWindowingTarget; // When selecting a window (holding Menu+FocusPrev/Next, or equivalent of CTRL-TAB) this window is temporarily displayed top-most.
|
||||
ImGuiWindow* NavWindowingTargetAnim; // Record of last valid NavWindowingTarget until DimBgRatio and NavWindowingHighlightAlpha becomes 0.0f
|
||||
ImGuiWindow* NavWindowingList;
|
||||
float NavWindowingTimer;
|
||||
@ -1299,7 +1299,7 @@ struct IMGUI_API ImGuiWindow
|
||||
// The best way to understand what those rectangles are is to use the 'Metrics -> Tools -> Show windows rectangles' viewer.
|
||||
// The main 'OuterRect', omitted as a field, is window->Rect().
|
||||
ImRect OuterRectClipped; // == Window->Rect() just after setup in Begin(). == window->Rect() for root window.
|
||||
ImRect InnerRect; // Inner rectangle (omit title bar, menu bar)
|
||||
ImRect InnerRect; // Inner rectangle (omit title bar, menu bar, scroll bar)
|
||||
ImRect InnerClipRect; // == InnerRect shrunk by WindowPadding*0.5f on each side, clipped within viewport or parent clip rect.
|
||||
ImRect WorkRect; // Cover the whole scrolling region, shrunk by WindowPadding*1.0f on each side. This is meant to replace ContentsRegionRect over time (from 1.71+ onward).
|
||||
ImRect ClipRect; // Current clipping/scissoring rectangle, evolve as we are using PushClipRect(), etc. == DrawList->clip_rect_stack.back().
|
||||
@ -1520,7 +1520,7 @@ namespace ImGui
|
||||
IMGUI_API bool IsPopupOpen(ImGuiID id); // Test for id within current popup stack level (currently begin-ed into); this doesn't scan the whole popup stack!
|
||||
IMGUI_API bool BeginPopupEx(ImGuiID id, ImGuiWindowFlags extra_flags);
|
||||
IMGUI_API void BeginTooltipEx(ImGuiWindowFlags extra_flags, bool override_previous_tooltip = true);
|
||||
IMGUI_API ImGuiWindow* GetFrontMostPopupModal();
|
||||
IMGUI_API ImGuiWindow* GetTopMostPopupModal();
|
||||
IMGUI_API ImVec2 FindBestWindowPosForPopup(ImGuiWindow* window);
|
||||
IMGUI_API ImVec2 FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& size, ImGuiDir* last_dir, const ImRect& r_outer, const ImRect& r_avoid, ImGuiPopupPositionPolicy policy = ImGuiPopupPositionPolicy_Default);
|
||||
|
||||
|
5
3rdparty/dear-imgui/imgui_widgets.cpp
vendored
5
3rdparty/dear-imgui/imgui_widgets.cpp
vendored
@ -63,10 +63,9 @@ Index of this file:
|
||||
#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double.
|
||||
#endif
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked
|
||||
#if __GNUC__ >= 8
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess" // warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Wclass-memaccess" // [__GNUC__ >= 8] warning: 'memset/memcpy' clearing/writing an object of type 'xxxx' with no trivial copy-assignment; use assignment or value-initialization instead
|
||||
#endif
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user