mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-13 08:19:55 +02:00
Merge branch 'master' into docking + dockspace demo comments
# Conflicts: # backends/imgui_impl_opengl3.cpp # docs/CHANGELOG.txt # imgui_internal.h # imgui_widgets.cpp
This commit is contained in:
@ -708,9 +708,9 @@ static void ShowDemoWindowWidgets()
|
||||
static float col2[4] = { 0.4f, 0.7f, 0.0f, 0.5f };
|
||||
ImGui::ColorEdit3("color 1", col1);
|
||||
ImGui::SameLine(); HelpMarker(
|
||||
"Click on the colored square to open a color picker.\n"
|
||||
"Click on the color square to open a color picker.\n"
|
||||
"Click and hold to use drag and drop.\n"
|
||||
"Right-click on the colored square to show options.\n"
|
||||
"Right-click on the color square to show options.\n"
|
||||
"CTRL+click on individual component to input value.\n");
|
||||
|
||||
ImGui::ColorEdit4("color 2", col2);
|
||||
@ -879,7 +879,7 @@ static void ShowDemoWindowWidgets()
|
||||
|
||||
if (ImGui::TreeNode("Text"))
|
||||
{
|
||||
if (ImGui::TreeNode("Colored Text"))
|
||||
if (ImGui::TreeNode("Colorful Text"))
|
||||
{
|
||||
// Using shortcut. You can use PushStyleColor()/PopStyleColor() for more flexibility.
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.0f, 1.0f, 1.0f), "Pink");
|
||||
@ -1461,7 +1461,7 @@ static void ShowDemoWindowWidgets()
|
||||
|
||||
ImGui::Text("Color widget:");
|
||||
ImGui::SameLine(); HelpMarker(
|
||||
"Click on the colored square to open a color picker.\n"
|
||||
"Click on the color square to open a color picker.\n"
|
||||
"CTRL+click on individual component to input value.\n");
|
||||
ImGui::ColorEdit3("MyColor##1", (float*)&color, misc_flags);
|
||||
|
||||
@ -1881,7 +1881,7 @@ static void ShowDemoWindowWidgets()
|
||||
// They are using standardized payload strings IMGUI_PAYLOAD_TYPE_COLOR_3F and IMGUI_PAYLOAD_TYPE_COLOR_4F
|
||||
// to allow your own widgets to use colors in their drag and drop interaction.
|
||||
// Also see 'Demo->Widgets->Color/Picker Widgets->Palette' demo.
|
||||
HelpMarker("You can drag from the colored squares.");
|
||||
HelpMarker("You can drag from the color squares.");
|
||||
static float col1[3] = { 1.0f, 0.0f, 0.2f };
|
||||
static float col2[4] = { 0.4f, 0.7f, 0.0f, 0.5f };
|
||||
ImGui::ColorEdit3("color 1", col1);
|
||||
@ -4059,7 +4059,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
if (ImGui::RadioButton("Both", alpha_flags == ImGuiColorEditFlags_AlphaPreviewHalf)) { alpha_flags = ImGuiColorEditFlags_AlphaPreviewHalf; } ImGui::SameLine();
|
||||
HelpMarker(
|
||||
"In the color list:\n"
|
||||
"Left-click on colored square to open color picker,\n"
|
||||
"Left-click on color square to open color picker,\n"
|
||||
"Right-click to open edit options menu.");
|
||||
|
||||
ImGui::BeginChild("##colors", ImVec2(0, 0), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened);
|
||||
@ -5401,11 +5401,24 @@ static void ShowExampleAppCustomRendering(bool* p_open)
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Demonstrate using DockSpace() to create an explicit docking node within an existing window.
|
||||
// Note that you already dock windows into each others _without_ a DockSpace() by just moving windows
|
||||
// from their title bar (or by holding SHIFT if io.ConfigDockingWithShift is set).
|
||||
// DockSpace() is only useful to construct to a central location for your application.
|
||||
// Note that you dock windows into each others _without_ a dockspace, by just clicking on
|
||||
// a window title bar and moving it (+ hold SHIFT if io.ConfigDockingWithShift is set).
|
||||
// DockSpace() and DockSpaceOverViewport() are only useful to construct a central docking
|
||||
// location for your application.
|
||||
void ShowExampleAppDockSpace(bool* p_open)
|
||||
{
|
||||
// In 99% case you should be able to just call DockSpaceOverViewport() and ignore all the code below!
|
||||
// In this specific demo, we are not using DockSpaceOverViewport() because:
|
||||
// - we allow the host window to be floating/moveable instead of filling the viewport (when opt_fullscreen == false)
|
||||
// - we allow the host window to have padding (when opt_padding == true)
|
||||
// - we have a local menu bar in the host window (vs. you could use BeginMainMenuBar() + DockSpaceOverViewport() in your code!)
|
||||
// TL;DR; this demo is more complicated than what you would normally use.
|
||||
// If we removed all the options we are showcasing, this demo would become:
|
||||
// void ShowExampleAppDockSpace()
|
||||
// {
|
||||
// ImGui::DockSpaceOverViewport(ImGui::GetMainViewport());
|
||||
// }
|
||||
|
||||
static bool opt_fullscreen = true;
|
||||
static bool opt_padding = false;
|
||||
static ImGuiDockNodeFlags dockspace_flags = ImGuiDockNodeFlags_None;
|
||||
|
Reference in New Issue
Block a user