mirror of
https://github.com/ocornut/imgui.git
synced 2026-03-20 07:29:43 +00:00
Merge branch 'master' into docking
# Conflicts: # backends/imgui_impl_vulkan.cpp # imgui.cpp # imgui_demo.cpp
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
|
||||
// How to easily locate code?
|
||||
// - Use Tools->Item Picker to debug break in code by clicking any widgets: https://github.com/ocornut/imgui/wiki/Debug-Tools
|
||||
// - Browse an online version the demo with code linked to hovered widgets: https://pthom.github.io/imgui_manual_online/manual/imgui_manual.html
|
||||
// - Browse pthom's online imgui_explorer: web version the demo w/ source code browser: https://pthom.github.io/imgui_explorer
|
||||
// - Find a visible string and search for it in the code!
|
||||
|
||||
//---------------------------------------------------
|
||||
@@ -294,9 +294,9 @@ static void ShowDockingDisabledMessage()
|
||||
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
||||
}
|
||||
|
||||
// Helper to wire demo markers located in code to an interactive browser (e.g. imgui_manual)
|
||||
// Helper to wire demo markers located in code to an interactive browser (e.g. https://pthom.github.io/imgui_explorer)
|
||||
#if IMGUI_VERSION_NUM >= 19263
|
||||
namespace ImGui { extern IMGUI_API void DemoMarker(const char* file, int line, const char* section); };
|
||||
namespace ImGui { extern IMGUI_API void DemoMarker(const char* file, int line, const char* section); }
|
||||
#define IMGUI_DEMO_MARKER(section) do { ImGui::DemoMarker("imgui_demo.cpp", __LINE__, section); } while (0)
|
||||
#endif
|
||||
|
||||
@@ -459,6 +459,9 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
ImGui::BulletText("The \"Examples\" menu above leads to more demo contents.");
|
||||
ImGui::BulletText("The \"Tools\" menu above gives access to: About Box, Style Editor,\n"
|
||||
"and Metrics/Debugger (general purpose Dear ImGui debugging tool).");
|
||||
ImGui::BulletText("Web demo (w/ source code browser): ");
|
||||
ImGui::SameLine(0, 0);
|
||||
ImGui::TextLinkOpenURL("https://pthom.github.io/imgui_explorer");
|
||||
|
||||
ImGui::SeparatorText("PROGRAMMER GUIDE:");
|
||||
ImGui::BulletText("See the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!");
|
||||
@@ -587,7 +590,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
ImGui::Checkbox("io.ConfigInputTextCursorBlink", &io.ConfigInputTextCursorBlink);
|
||||
ImGui::SameLine(); HelpMarker("Enable blinking cursor (optional as some users consider it to be distracting).");
|
||||
ImGui::Checkbox("io.ConfigInputTextEnterKeepActive", &io.ConfigInputTextEnterKeepActive);
|
||||
ImGui::SameLine(); HelpMarker("Pressing Enter will keep item active and select contents (single-line only).");
|
||||
ImGui::SameLine(); HelpMarker("Pressing Enter will reactivate item and select all text (single-line only).");
|
||||
ImGui::Checkbox("io.ConfigDragClickToInputText", &io.ConfigDragClickToInputText);
|
||||
ImGui::SameLine(); HelpMarker("Enable turning DragXXX widgets into text input with a simple mouse click-release (without moving).");
|
||||
ImGui::Checkbox("io.ConfigMacOSXBehaviors", &io.ConfigMacOSXBehaviors);
|
||||
@@ -1794,7 +1797,6 @@ static void DemoWindowWidgetsDragsAndSliders()
|
||||
ImGui::CheckboxFlags("ImGuiSliderFlags_WrapAround", &flags, ImGuiSliderFlags_WrapAround);
|
||||
ImGui::SameLine(); HelpMarker("Enable wrapping around from max to min and from min to max (only supported by DragXXX() functions)");
|
||||
ImGui::CheckboxFlags("ImGuiSliderFlags_ColorMarkers", &flags, ImGuiSliderFlags_ColorMarkers);
|
||||
//ImGui::CheckboxFlags("ImGuiSliderFlags_ColorMarkersG", &flags, 1 << ImGuiSliderFlags_ColorMarkersIndexShift_); // Not explicitly documented but possible.
|
||||
|
||||
// Drags
|
||||
static float drag_f = 0.5f;
|
||||
@@ -2010,29 +2012,32 @@ static void DemoWindowWidgetsMultiComponents()
|
||||
static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
|
||||
static int vec4i[4] = { 1, 5, 100, 255 };
|
||||
|
||||
static ImGuiSliderFlags flags = 0;
|
||||
ImGui::CheckboxFlags("ImGuiSliderFlags_ColorMarkers", &flags, ImGuiSliderFlags_ColorMarkers); // Only passing this to Drag/Sliders
|
||||
|
||||
ImGui::SeparatorText("2-wide");
|
||||
ImGui::InputFloat2("input float2", vec4f);
|
||||
ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f);
|
||||
ImGui::SliderFloat2("slider float2", vec4f, 0.0f, 1.0f);
|
||||
ImGui::InputInt2("input int2", vec4i);
|
||||
ImGui::DragInt2("drag int2", vec4i, 1, 0, 255);
|
||||
ImGui::SliderInt2("slider int2", vec4i, 0, 255);
|
||||
ImGui::DragFloat2("drag float2", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);
|
||||
ImGui::DragInt2("drag int2", vec4i, 1, 0, 255, NULL, flags);
|
||||
ImGui::SliderFloat2("slider float2", vec4f, 0.0f, 1.0f, NULL, flags);
|
||||
ImGui::SliderInt2("slider int2", vec4i, 0, 255, NULL, flags);
|
||||
|
||||
ImGui::SeparatorText("3-wide");
|
||||
ImGui::InputFloat3("input float3", vec4f);
|
||||
ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f);
|
||||
ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f);
|
||||
ImGui::InputInt3("input int3", vec4i);
|
||||
ImGui::DragInt3("drag int3", vec4i, 1, 0, 255);
|
||||
ImGui::SliderInt3("slider int3", vec4i, 0, 255);
|
||||
ImGui::DragFloat3("drag float3", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);
|
||||
ImGui::DragInt3("drag int3", vec4i, 1, 0, 255, NULL, flags);
|
||||
ImGui::SliderFloat3("slider float3", vec4f, 0.0f, 1.0f, NULL, flags);
|
||||
ImGui::SliderInt3("slider int3", vec4i, 0, 255, NULL, flags);
|
||||
|
||||
ImGui::SeparatorText("4-wide");
|
||||
ImGui::InputFloat4("input float4", vec4f);
|
||||
ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f);
|
||||
ImGui::SliderFloat4("slider float4", vec4f, 0.0f, 1.0f);
|
||||
ImGui::InputInt4("input int4", vec4i);
|
||||
ImGui::DragInt4("drag int4", vec4i, 1, 0, 255);
|
||||
ImGui::SliderInt4("slider int4", vec4i, 0, 255);
|
||||
ImGui::DragFloat4("drag float4", vec4f, 0.01f, 0.0f, 1.0f, NULL, flags);
|
||||
ImGui::DragInt4("drag int4", vec4i, 1, 0, 255, NULL, flags);
|
||||
ImGui::SliderFloat4("slider float4", vec4f, 0.0f, 1.0f, NULL, flags);
|
||||
ImGui::SliderInt4("slider int4", vec4i, 0, 255, NULL, flags);
|
||||
|
||||
ImGui::SeparatorText("Ranges");
|
||||
static float begin = 10, end = 90;
|
||||
@@ -8613,6 +8618,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
SameLine(); HelpMarker("Alignment applies when a button is larger than its text content.");
|
||||
SliderFloat2("SelectableTextAlign", (float*)&style.SelectableTextAlign, 0.0f, 1.0f, "%.2f");
|
||||
SameLine(); HelpMarker("Alignment applies when a selectable is larger than its text content.");
|
||||
SliderFloat("SeparatorSize", &style.SeparatorSize, 0.0f, 10.0f, "%.0f");
|
||||
SliderFloat("SeparatorTextBorderSize", &style.SeparatorTextBorderSize, 0.0f, 10.0f, "%.0f");
|
||||
SliderFloat2("SeparatorTextAlign", (float*)&style.SeparatorTextAlign, 0.0f, 1.0f, "%.2f");
|
||||
SliderFloat2("SeparatorTextPadding", (float*)&style.SeparatorTextPadding, 0.0f, 40.0f, "%.0f");
|
||||
@@ -9086,7 +9092,8 @@ struct ExampleAppConsole
|
||||
ImGui::Separator();
|
||||
|
||||
// Reserve enough left-over height for 1 separator + 1 input text
|
||||
const float footer_height_to_reserve = ImGui::GetStyle().ItemSpacing.y + ImGui::GetFrameHeightWithSpacing();
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
const float footer_height_to_reserve = style.SeparatorSize + style.ItemSpacing.y + ImGui::GetFrameHeightWithSpacing();
|
||||
if (ImGui::BeginChild("ScrollingRegion", ImVec2(0, -footer_height_to_reserve), ImGuiChildFlags_NavFlattened, ImGuiWindowFlags_HorizontalScrollbar))
|
||||
{
|
||||
if (ImGui::BeginPopupContextWindow())
|
||||
@@ -10115,7 +10122,7 @@ static void ShowExampleAppWindowTitles(bool*)
|
||||
|
||||
ImGui::SetNextWindowPos(ImVec2(base_pos.x + 100, base_pos.y + 200), ImGuiCond_FirstUseEver);
|
||||
ImGui::Begin("Same title as another window##2");
|
||||
IMGUI_DEMO_MARKER("Examples/Manipulating window titles##2");;
|
||||
IMGUI_DEMO_MARKER("Examples/Manipulating window titles##2");
|
||||
ImGui::Text("This is window 2.\nMy title is the same as window 1, but my identifier is unique.");
|
||||
ImGui::End();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user