mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-06 13:27:47 +00:00
Merge branch 'master' into docking
# Conflicts: # imgui.cpp # imgui_internal.h
This commit is contained in:
31
imgui.cpp
31
imgui.cpp
@@ -1482,6 +1482,7 @@ ImGuiStyle::ImGuiStyle()
|
||||
DragDropTargetRounding = 0.0f; // Radius of the drag and drop target frame.
|
||||
DragDropTargetBorderSize = 2.0f; // Thickness of the drag and drop target border.
|
||||
DragDropTargetPadding = 3.0f; // Size to expand the drag and drop target from actual target item size.
|
||||
ColorMarkerSize = 3.0f; // Size of R/G/B/A color markers for ColorEdit4() and for Drags/Sliders when using ImGuiSliderFlags_ColorMarkers.
|
||||
ColorButtonPosition = ImGuiDir_Right; // Side of the color button in the ColorEdit4 widget (left/right). Defaults to ImGuiDir_Right.
|
||||
ButtonTextAlign = ImVec2(0.5f,0.5f);// Alignment of button text when button is larger than text.
|
||||
SelectableTextAlign = ImVec2(0.0f,0.0f);// Alignment of selectable text. Defaults to (0.0f, 0.0f) (top-left aligned). It's generally important to keep this left-aligned if you want to lay multiple items on a same line.
|
||||
@@ -1551,6 +1552,7 @@ void ImGuiStyle::ScaleAllSizes(float scale_factor)
|
||||
DragDropTargetRounding = ImTrunc(DragDropTargetRounding * scale_factor);
|
||||
DragDropTargetBorderSize = ImTrunc(DragDropTargetBorderSize * scale_factor);
|
||||
DragDropTargetPadding = ImTrunc(DragDropTargetPadding * scale_factor);
|
||||
ColorMarkerSize = ImTrunc(ColorMarkerSize * scale_factor);
|
||||
SeparatorTextPadding = ImTrunc(SeparatorTextPadding * scale_factor);
|
||||
DockingSeparatorSize = ImTrunc(DockingSeparatorSize * scale_factor);
|
||||
DisplayWindowPadding = ImTrunc(DisplayWindowPadding * scale_factor);
|
||||
@@ -3998,6 +4000,18 @@ void ImGui::RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding)
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Might move those to style if there is a real need.
|
||||
static const ImU32 GColorMarkers[4] = { IM_COL32(240,20,20,255), IM_COL32(20,240,20,255), IM_COL32(20,20,240,255), IM_COL32(140,140,140,255) };
|
||||
|
||||
void ImGui::RenderColorComponentMarker(int component_idx, const ImRect& bb, float rounding)
|
||||
{
|
||||
if (!(component_idx >= 0 && component_idx < 4) || (bb.Min.x + 1 >= bb.Max.x))
|
||||
return;
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* window = g.CurrentWindow;
|
||||
RenderRectFilledInRangeH(window->DrawList, bb, GetColorU32(GColorMarkers[component_idx]), bb.Min.x, ImMin(bb.Min.x + g.Style.ColorMarkerSize, bb.Max.x), rounding);
|
||||
}
|
||||
|
||||
void ImGui::RenderNavCursor(const ImRect& bb, ImGuiID id, ImGuiNavRenderCursorFlags flags)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
@@ -15281,13 +15295,12 @@ void ImGui::NavUpdateWindowingOverlay()
|
||||
if (g.NavWindowingTimer < NAV_WINDOWING_LIST_APPEAR_DELAY)
|
||||
return;
|
||||
|
||||
if (g.NavWindowingListWindow == NULL)
|
||||
g.NavWindowingListWindow = FindWindowByName("##NavWindowingOverlay");
|
||||
const ImGuiViewport* viewport = /*g.NavWindow ? g.NavWindow->Viewport :*/ GetMainViewport();
|
||||
SetNextWindowSizeConstraints(ImVec2(viewport->Size.x * 0.20f, viewport->Size.y * 0.20f), ImVec2(FLT_MAX, FLT_MAX));
|
||||
SetNextWindowPos(viewport->GetCenter(), ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
||||
PushStyleVar(ImGuiStyleVar_WindowPadding, g.Style.WindowPadding * 2.0f);
|
||||
Begin("##NavWindowingOverlay", NULL, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings);
|
||||
g.NavWindowingListWindow = g.CurrentWindow;
|
||||
if (g.ContextName[0] != 0)
|
||||
SeparatorText(g.ContextName);
|
||||
for (int n = g.WindowsFocusOrder.Size - 1; n >= 0; n--)
|
||||
@@ -23522,14 +23535,23 @@ void ImGui::DebugLogV(const char* fmt, va_list args)
|
||||
g.DebugLogBuf.appendf("[%05d] ", g.FrameCount);
|
||||
g.DebugLogBuf.appendfv(fmt, args);
|
||||
g.DebugLogIndex.append(g.DebugLogBuf.c_str(), old_size, g.DebugLogBuf.size());
|
||||
|
||||
const char* str = g.DebugLogBuf.begin() + old_size;
|
||||
if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTTY)
|
||||
IMGUI_DEBUG_PRINTF("%s", g.DebugLogBuf.begin() + old_size);
|
||||
IMGUI_DEBUG_PRINTF("%s", str);
|
||||
#if defined(_WIN32) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS)
|
||||
if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToDebugger)
|
||||
{
|
||||
::OutputDebugStringA("[imgui] ");
|
||||
::OutputDebugStringA(str);
|
||||
}
|
||||
#endif
|
||||
#ifdef IMGUI_ENABLE_TEST_ENGINE
|
||||
// IMGUI_TEST_ENGINE_LOG() adds a trailing \n automatically
|
||||
const int new_size = g.DebugLogBuf.size();
|
||||
const bool trailing_carriage_return = (g.DebugLogBuf[new_size - 1] == '\n');
|
||||
if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTestEngine)
|
||||
IMGUI_TEST_ENGINE_LOG("%.*s", new_size - old_size - (trailing_carriage_return ? 1 : 0), g.DebugLogBuf.begin() + old_size);
|
||||
IMGUI_TEST_ENGINE_LOG("%.*s", new_size - old_size - (trailing_carriage_return ? 1 : 0), str);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -23611,6 +23633,7 @@ void ImGui::ShowDebugLogWindow(bool* p_open)
|
||||
if (BeginPopup("Outputs"))
|
||||
{
|
||||
CheckboxFlags("OutputToTTY", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToTTY);
|
||||
CheckboxFlags("OutputToDebugger", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToDebugger);
|
||||
#ifndef IMGUI_ENABLE_TEST_ENGINE
|
||||
BeginDisabled();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user