mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 19:29:19 +02:00
reformat: remove redundant qualifiers
This commit is contained in:
@@ -152,25 +152,25 @@ static void HelpMarker(const char* desc)
|
||||
// Helper to display basic user controls.
|
||||
void ImGui::ShowUserGuide()
|
||||
{
|
||||
const ImGuiIO & io = ImGui::GetIO();
|
||||
ImGui::BulletText("Double-click on title bar to collapse window.");
|
||||
ImGui::BulletText("Click and drag on lower right corner to resize window\n(double-click to auto fit window to its contents).");
|
||||
ImGui::BulletText("Click and drag on any empty space to move window.");
|
||||
ImGui::BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields.");
|
||||
ImGui::BulletText("CTRL+Click on a slider or drag box to input value as text.");
|
||||
const ImGuiIO & io = GetIO();
|
||||
BulletText("Double-click on title bar to collapse window.");
|
||||
BulletText("Click and drag on lower right corner to resize window\n(double-click to auto fit window to its contents).");
|
||||
BulletText("Click and drag on any empty space to move window.");
|
||||
BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields.");
|
||||
BulletText("CTRL+Click on a slider or drag box to input value as text.");
|
||||
if (io.FontAllowUserScaling)
|
||||
ImGui::BulletText("CTRL+Mouse Wheel to zoom window contents.");
|
||||
ImGui::BulletText("Mouse Wheel to scroll.");
|
||||
ImGui::BulletText("While editing text:\n");
|
||||
ImGui::Indent();
|
||||
ImGui::BulletText("Hold SHIFT or use mouse to select text.");
|
||||
ImGui::BulletText("CTRL+Left/Right to word jump.");
|
||||
ImGui::BulletText("CTRL+A or double-click to select all.");
|
||||
ImGui::BulletText("CTRL+X,CTRL+C,CTRL+V to use clipboard.");
|
||||
ImGui::BulletText("CTRL+Z,CTRL+Y to undo/redo.");
|
||||
ImGui::BulletText("ESCAPE to revert.");
|
||||
ImGui::BulletText("You can apply arithmetic operators +,*,/ on numerical values.\nUse +- to subtract.");
|
||||
ImGui::Unindent();
|
||||
BulletText("CTRL+Mouse Wheel to zoom window contents.");
|
||||
BulletText("Mouse Wheel to scroll.");
|
||||
BulletText("While editing text:\n");
|
||||
Indent();
|
||||
BulletText("Hold SHIFT or use mouse to select text.");
|
||||
BulletText("CTRL+Left/Right to word jump.");
|
||||
BulletText("CTRL+A or double-click to select all.");
|
||||
BulletText("CTRL+X,CTRL+C,CTRL+V to use clipboard.");
|
||||
BulletText("CTRL+Z,CTRL+Y to undo/redo.");
|
||||
BulletText("ESCAPE to revert.");
|
||||
BulletText("You can apply arithmetic operators +,*,/ on numerical values.\nUse +- to subtract.");
|
||||
Unindent();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -222,9 +222,9 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
static bool show_app_style_editor = false;
|
||||
static bool show_app_about = false;
|
||||
|
||||
if (show_app_metrics) { ImGui::ShowMetricsWindow(&show_app_metrics); }
|
||||
if (show_app_style_editor) { ImGui::Begin("Style Editor", &show_app_style_editor); ImGui::ShowStyleEditor(); ImGui::End(); }
|
||||
if (show_app_about) { ImGui::ShowAboutWindow(&show_app_about); }
|
||||
if (show_app_metrics) { ShowMetricsWindow(&show_app_metrics); }
|
||||
if (show_app_style_editor) { Begin("Style Editor", &show_app_style_editor); ShowStyleEditor(); End(); }
|
||||
if (show_app_about) { ShowAboutWindow(&show_app_about); }
|
||||
|
||||
// Demonstrate the various window flags. Typically you would just use the default!
|
||||
static bool no_titlebar = false;
|
||||
@@ -251,154 +251,154 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
if (no_close) p_open = NULL; // Don't pass our bool* to Begin
|
||||
|
||||
// We specify a default position/size in case there's no data in the .ini file. Typically this isn't required! We only do it to make the Demo applications a little more welcoming.
|
||||
ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowSize(ImVec2(550, 680), ImGuiCond_FirstUseEver);
|
||||
SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver);
|
||||
SetNextWindowSize(ImVec2(550, 680), ImGuiCond_FirstUseEver);
|
||||
|
||||
// Main body of the Demo window starts here.
|
||||
if (!ImGui::Begin("Dear ImGui Demo", p_open, window_flags))
|
||||
if (!Begin("Dear ImGui Demo", p_open, window_flags))
|
||||
{
|
||||
// Early out if the window is collapsed, as an optimization.
|
||||
ImGui::End();
|
||||
End();
|
||||
return;
|
||||
}
|
||||
|
||||
// Most "big" widgets share a common width settings by default.
|
||||
//ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.65f); // Use 2/3 of the space for widgets and 1/3 for labels (default)
|
||||
ImGui::PushItemWidth(ImGui::GetFontSize() * -12); // Use fixed width for labels (by passing a negative value), the rest goes to widgets. We choose a width proportional to our font size.
|
||||
PushItemWidth(GetFontSize() * -12); // Use fixed width for labels (by passing a negative value), the rest goes to widgets. We choose a width proportional to our font size.
|
||||
|
||||
// Menu Bar
|
||||
if (ImGui::BeginMenuBar())
|
||||
if (BeginMenuBar())
|
||||
{
|
||||
if (ImGui::BeginMenu("Menu"))
|
||||
if (BeginMenu("Menu"))
|
||||
{
|
||||
ShowExampleMenuFile();
|
||||
ImGui::EndMenu();
|
||||
EndMenu();
|
||||
}
|
||||
if (ImGui::BeginMenu("Examples"))
|
||||
if (BeginMenu("Examples"))
|
||||
{
|
||||
ImGui::MenuItem("Main menu bar", NULL, &show_app_main_menu_bar);
|
||||
ImGui::MenuItem("Console", NULL, &show_app_console);
|
||||
ImGui::MenuItem("Log", NULL, &show_app_log);
|
||||
ImGui::MenuItem("Simple layout", NULL, &show_app_layout);
|
||||
ImGui::MenuItem("Property editor", NULL, &show_app_property_editor);
|
||||
ImGui::MenuItem("Long text display", NULL, &show_app_long_text);
|
||||
ImGui::MenuItem("Auto-resizing window", NULL, &show_app_auto_resize);
|
||||
ImGui::MenuItem("Constrained-resizing window", NULL, &show_app_constrained_resize);
|
||||
ImGui::MenuItem("Simple overlay", NULL, &show_app_simple_overlay);
|
||||
ImGui::MenuItem("Manipulating window titles", NULL, &show_app_window_titles);
|
||||
ImGui::MenuItem("Custom rendering", NULL, &show_app_custom_rendering);
|
||||
ImGui::MenuItem("Documents", NULL, &show_app_documents);
|
||||
ImGui::EndMenu();
|
||||
MenuItem("Main menu bar", NULL, &show_app_main_menu_bar);
|
||||
MenuItem("Console", NULL, &show_app_console);
|
||||
MenuItem("Log", NULL, &show_app_log);
|
||||
MenuItem("Simple layout", NULL, &show_app_layout);
|
||||
MenuItem("Property editor", NULL, &show_app_property_editor);
|
||||
MenuItem("Long text display", NULL, &show_app_long_text);
|
||||
MenuItem("Auto-resizing window", NULL, &show_app_auto_resize);
|
||||
MenuItem("Constrained-resizing window", NULL, &show_app_constrained_resize);
|
||||
MenuItem("Simple overlay", NULL, &show_app_simple_overlay);
|
||||
MenuItem("Manipulating window titles", NULL, &show_app_window_titles);
|
||||
MenuItem("Custom rendering", NULL, &show_app_custom_rendering);
|
||||
MenuItem("Documents", NULL, &show_app_documents);
|
||||
EndMenu();
|
||||
}
|
||||
if (ImGui::BeginMenu("Help"))
|
||||
if (BeginMenu("Help"))
|
||||
{
|
||||
ImGui::MenuItem("Metrics", NULL, &show_app_metrics);
|
||||
ImGui::MenuItem("Style Editor", NULL, &show_app_style_editor);
|
||||
ImGui::MenuItem("About Dear ImGui", NULL, &show_app_about);
|
||||
ImGui::EndMenu();
|
||||
MenuItem("Metrics", NULL, &show_app_metrics);
|
||||
MenuItem("Style Editor", NULL, &show_app_style_editor);
|
||||
MenuItem("About Dear ImGui", NULL, &show_app_about);
|
||||
EndMenu();
|
||||
}
|
||||
ImGui::EndMenuBar();
|
||||
EndMenuBar();
|
||||
}
|
||||
|
||||
ImGui::Text("dear imgui says hello. (%s)", IMGUI_VERSION);
|
||||
ImGui::Spacing();
|
||||
Text("dear imgui says hello. (%s)", IMGUI_VERSION);
|
||||
Spacing();
|
||||
|
||||
if (ImGui::CollapsingHeader("Help"))
|
||||
if (CollapsingHeader("Help"))
|
||||
{
|
||||
ImGui::Text("PROGRAMMER GUIDE:");
|
||||
ImGui::BulletText("Please see the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!");
|
||||
ImGui::BulletText("Please see the comments in imgui.cpp.");
|
||||
ImGui::BulletText("Please see the examples/ in application.");
|
||||
ImGui::BulletText("Enable 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls.");
|
||||
ImGui::BulletText("Enable 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls.");
|
||||
ImGui::Separator();
|
||||
Text("PROGRAMMER GUIDE:");
|
||||
BulletText("Please see the ShowDemoWindow() code in imgui_demo.cpp. <- you are here!");
|
||||
BulletText("Please see the comments in imgui.cpp.");
|
||||
BulletText("Please see the examples/ in application.");
|
||||
BulletText("Enable 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls.");
|
||||
BulletText("Enable 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls.");
|
||||
Separator();
|
||||
|
||||
ImGui::Text("USER GUIDE:");
|
||||
ImGui::ShowUserGuide();
|
||||
Text("USER GUIDE:");
|
||||
ShowUserGuide();
|
||||
}
|
||||
|
||||
if (ImGui::CollapsingHeader("Configuration"))
|
||||
if (CollapsingHeader("Configuration"))
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
ImGuiIO& io = GetIO();
|
||||
|
||||
if (ImGui::TreeNode("Configuration##2"))
|
||||
if (TreeNode("Configuration##2"))
|
||||
{
|
||||
ImGui::CheckboxFlags("io.ConfigFlags: NavEnableKeyboard", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableKeyboard);
|
||||
ImGui::CheckboxFlags("io.ConfigFlags: NavEnableGamepad", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableGamepad);
|
||||
ImGui::SameLine(); HelpMarker("Required back-end to feed in gamepad inputs in io.NavInputs[] and set io.BackendFlags |= ImGuiBackendFlags_HasGamepad.\n\nRead instructions in imgui.cpp for details.");
|
||||
ImGui::CheckboxFlags("io.ConfigFlags: NavEnableSetMousePos", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableSetMousePos);
|
||||
ImGui::SameLine(); HelpMarker("Instruct navigation to move the mouse cursor. See comment for ImGuiConfigFlags_NavEnableSetMousePos.");
|
||||
ImGui::CheckboxFlags("io.ConfigFlags: NoMouse", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NoMouse);
|
||||
CheckboxFlags("io.ConfigFlags: NavEnableKeyboard", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableKeyboard);
|
||||
CheckboxFlags("io.ConfigFlags: NavEnableGamepad", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableGamepad);
|
||||
SameLine(); HelpMarker("Required back-end to feed in gamepad inputs in io.NavInputs[] and set io.BackendFlags |= ImGuiBackendFlags_HasGamepad.\n\nRead instructions in imgui.cpp for details.");
|
||||
CheckboxFlags("io.ConfigFlags: NavEnableSetMousePos", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NavEnableSetMousePos);
|
||||
SameLine(); HelpMarker("Instruct navigation to move the mouse cursor. See comment for ImGuiConfigFlags_NavEnableSetMousePos.");
|
||||
CheckboxFlags("io.ConfigFlags: NoMouse", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NoMouse);
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_NoMouse) // Create a way to restore this flag otherwise we could be stuck completely!
|
||||
{
|
||||
if (fmodf((float)ImGui::GetTime(), 0.40f) < 0.20f)
|
||||
if (fmodf((float)GetTime(), 0.40f) < 0.20f)
|
||||
{
|
||||
ImGui::SameLine();
|
||||
ImGui::Text("<<PRESS SPACE TO DISABLE>>");
|
||||
SameLine();
|
||||
Text("<<PRESS SPACE TO DISABLE>>");
|
||||
}
|
||||
if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Space)))
|
||||
if (IsKeyPressed(GetKeyIndex(ImGuiKey_Space)))
|
||||
io.ConfigFlags &= ~ImGuiConfigFlags_NoMouse;
|
||||
}
|
||||
ImGui::CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NoMouseCursorChange);
|
||||
ImGui::SameLine(); HelpMarker("Instruct back-end to not alter mouse cursor shape and visibility.");
|
||||
ImGui::Checkbox("io.ConfigInputTextCursorBlink", &io.ConfigInputTextCursorBlink);
|
||||
ImGui::SameLine(); HelpMarker("Set to false to disable blinking cursor, for users who consider it distracting");
|
||||
ImGui::Checkbox("io.ConfigWindowsResizeFromEdges", &io.ConfigWindowsResizeFromEdges);
|
||||
ImGui::SameLine(); HelpMarker("Enable resizing of windows from their edges and from the lower-left corner.\nThis requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback.");
|
||||
ImGui::Checkbox("io.ConfigWindowsMoveFromTitleBarOnly", &io.ConfigWindowsMoveFromTitleBarOnly);
|
||||
ImGui::Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor);
|
||||
ImGui::SameLine(); HelpMarker("Instruct Dear ImGui to render a mouse cursor for you. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something).");
|
||||
ImGui::TreePop();
|
||||
ImGui::Separator();
|
||||
CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", (unsigned int *)&io.ConfigFlags, ImGuiConfigFlags_NoMouseCursorChange);
|
||||
SameLine(); HelpMarker("Instruct back-end to not alter mouse cursor shape and visibility.");
|
||||
Checkbox("io.ConfigInputTextCursorBlink", &io.ConfigInputTextCursorBlink);
|
||||
SameLine(); HelpMarker("Set to false to disable blinking cursor, for users who consider it distracting");
|
||||
Checkbox("io.ConfigWindowsResizeFromEdges", &io.ConfigWindowsResizeFromEdges);
|
||||
SameLine(); HelpMarker("Enable resizing of windows from their edges and from the lower-left corner.\nThis requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback.");
|
||||
Checkbox("io.ConfigWindowsMoveFromTitleBarOnly", &io.ConfigWindowsMoveFromTitleBarOnly);
|
||||
Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor);
|
||||
SameLine(); HelpMarker("Instruct Dear ImGui to render a mouse cursor for you. Note that a mouse cursor rendered via your application GPU rendering path will feel more laggy than hardware cursor, but will be more in sync with your other visuals.\n\nSome desktop applications may use both kinds of cursors (e.g. enable software cursor only when resizing/dragging something).");
|
||||
TreePop();
|
||||
Separator();
|
||||
}
|
||||
|
||||
if (ImGui::TreeNode("Backend Flags"))
|
||||
if (TreeNode("Backend Flags"))
|
||||
{
|
||||
HelpMarker("Those flags are set by the back-ends (imgui_impl_xxx files) to specify their capabilities.");
|
||||
ImGuiBackendFlags backend_flags = io.BackendFlags; // Make a local copy to avoid modifying actual back-end flags.
|
||||
ImGui::CheckboxFlags("io.BackendFlags: HasGamepad", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasGamepad);
|
||||
ImGui::CheckboxFlags("io.BackendFlags: HasMouseCursors", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasMouseCursors);
|
||||
ImGui::CheckboxFlags("io.BackendFlags: HasSetMousePos", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasSetMousePos);
|
||||
ImGui::CheckboxFlags("io.BackendFlags: RendererHasVtxOffset", (unsigned int *)&backend_flags, ImGuiBackendFlags_RendererHasVtxOffset);
|
||||
ImGui::TreePop();
|
||||
ImGui::Separator();
|
||||
CheckboxFlags("io.BackendFlags: HasGamepad", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasGamepad);
|
||||
CheckboxFlags("io.BackendFlags: HasMouseCursors", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasMouseCursors);
|
||||
CheckboxFlags("io.BackendFlags: HasSetMousePos", (unsigned int *)&backend_flags, ImGuiBackendFlags_HasSetMousePos);
|
||||
CheckboxFlags("io.BackendFlags: RendererHasVtxOffset", (unsigned int *)&backend_flags, ImGuiBackendFlags_RendererHasVtxOffset);
|
||||
TreePop();
|
||||
Separator();
|
||||
}
|
||||
|
||||
if (ImGui::TreeNode("Style"))
|
||||
if (TreeNode("Style"))
|
||||
{
|
||||
ImGui::ShowStyleEditor();
|
||||
ImGui::TreePop();
|
||||
ImGui::Separator();
|
||||
ShowStyleEditor();
|
||||
TreePop();
|
||||
Separator();
|
||||
}
|
||||
|
||||
if (ImGui::TreeNode("Capture/Logging"))
|
||||
if (TreeNode("Capture/Logging"))
|
||||
{
|
||||
ImGui::TextWrapped("The logging API redirects all text output so you can easily capture the content of a window or a block. Tree nodes can be automatically expanded.");
|
||||
TextWrapped("The logging API redirects all text output so you can easily capture the content of a window or a block. Tree nodes can be automatically expanded.");
|
||||
HelpMarker("Try opening any of the contents below in this window and then click one of the \"Log To\" button.");
|
||||
ImGui::LogButtons();
|
||||
ImGui::TextWrapped("You can also call ImGui::LogText() to output directly to the log without a visual output.");
|
||||
if (ImGui::Button("Copy \"Hello, world!\" to clipboard"))
|
||||
LogButtons();
|
||||
TextWrapped("You can also call ImGui::LogText() to output directly to the log without a visual output.");
|
||||
if (Button("Copy \"Hello, world!\" to clipboard"))
|
||||
{
|
||||
ImGui::LogToClipboard();
|
||||
ImGui::LogText("Hello, world!");
|
||||
ImGui::LogFinish();
|
||||
LogToClipboard();
|
||||
LogText("Hello, world!");
|
||||
LogFinish();
|
||||
}
|
||||
ImGui::TreePop();
|
||||
TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
if (ImGui::CollapsingHeader("Window options"))
|
||||
if (CollapsingHeader("Window options"))
|
||||
{
|
||||
ImGui::Checkbox("No titlebar", &no_titlebar); ImGui::SameLine(150);
|
||||
ImGui::Checkbox("No scrollbar", &no_scrollbar); ImGui::SameLine(300);
|
||||
ImGui::Checkbox("No menu", &no_menu);
|
||||
ImGui::Checkbox("No move", &no_move); ImGui::SameLine(150);
|
||||
ImGui::Checkbox("No resize", &no_resize); ImGui::SameLine(300);
|
||||
ImGui::Checkbox("No collapse", &no_collapse);
|
||||
ImGui::Checkbox("No close", &no_close); ImGui::SameLine(150);
|
||||
ImGui::Checkbox("No nav", &no_nav); ImGui::SameLine(300);
|
||||
ImGui::Checkbox("No background", &no_background);
|
||||
ImGui::Checkbox("No bring to front", &no_bring_to_front);
|
||||
Checkbox("No titlebar", &no_titlebar); SameLine(150);
|
||||
Checkbox("No scrollbar", &no_scrollbar); SameLine(300);
|
||||
Checkbox("No menu", &no_menu);
|
||||
Checkbox("No move", &no_move); SameLine(150);
|
||||
Checkbox("No resize", &no_resize); SameLine(300);
|
||||
Checkbox("No collapse", &no_collapse);
|
||||
Checkbox("No close", &no_close); SameLine(150);
|
||||
Checkbox("No nav", &no_nav); SameLine(300);
|
||||
Checkbox("No background", &no_background);
|
||||
Checkbox("No bring to front", &no_bring_to_front);
|
||||
}
|
||||
|
||||
// All demo contents
|
||||
@@ -409,7 +409,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
ShowDemoWindowMisc();
|
||||
|
||||
// End of ShowDemoWindow()
|
||||
ImGui::End();
|
||||
End();
|
||||
}
|
||||
|
||||
static void ShowDemoWindowWidgets()
|
||||
@@ -1016,7 +1016,7 @@ static void ShowDemoWindowWidgets()
|
||||
static bool MyInputTextMultiline(const char* label, ImVector<char>* my_str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0)
|
||||
{
|
||||
IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0);
|
||||
return ImGui::InputTextMultiline(label, my_str->begin(), (size_t)my_str->size(), size, flags | ImGuiInputTextFlags_CallbackResize, Funcs::MyResizeCallback, (void*)my_str);
|
||||
return ImGui::InputTextMultiline(label, my_str->begin(), (size_t)my_str->size(), size, flags | ImGuiInputTextFlags_CallbackResize, MyResizeCallback, (void*)my_str);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2879,32 +2879,32 @@ static void ShowDemoWindowMisc()
|
||||
|
||||
void ImGui::ShowAboutWindow(bool* p_open)
|
||||
{
|
||||
if (!ImGui::Begin("About Dear ImGui", p_open, ImGuiWindowFlags_AlwaysAutoResize))
|
||||
if (!Begin("About Dear ImGui", p_open, ImGuiWindowFlags_AlwaysAutoResize))
|
||||
{
|
||||
ImGui::End();
|
||||
End();
|
||||
return;
|
||||
}
|
||||
ImGui::Text("Dear ImGui %s", ImGui::GetVersion());
|
||||
ImGui::Separator();
|
||||
ImGui::Text("By Omar Cornut and all dear imgui contributors.");
|
||||
ImGui::Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information.");
|
||||
Text("Dear ImGui %s", GetVersion());
|
||||
Separator();
|
||||
Text("By Omar Cornut and all dear imgui contributors.");
|
||||
Text("Dear ImGui is licensed under the MIT License, see LICENSE for more information.");
|
||||
|
||||
static bool show_config_info = false;
|
||||
ImGui::Checkbox("Config/Build Information", &show_config_info);
|
||||
Checkbox("Config/Build Information", &show_config_info);
|
||||
if (show_config_info)
|
||||
{
|
||||
const ImGuiIO & io = ImGui::GetIO();
|
||||
const ImGuiStyle & style = ImGui::GetStyle();
|
||||
const ImGuiIO & io = GetIO();
|
||||
const ImGuiStyle & style = GetStyle();
|
||||
|
||||
const bool copy_to_clipboard = ImGui::Button("Copy to clipboard");
|
||||
ImGui::BeginChildFrame(ImGui::GetID("cfginfos"), ImVec2(0, ImGui::GetTextLineHeightWithSpacing() * 18), ImGuiWindowFlags_NoMove);
|
||||
const bool copy_to_clipboard = Button("Copy to clipboard");
|
||||
BeginChildFrame(GetID("cfginfos"), ImVec2(0, GetTextLineHeightWithSpacing() * 18), ImGuiWindowFlags_NoMove);
|
||||
if (copy_to_clipboard)
|
||||
ImGui::LogToClipboard();
|
||||
LogToClipboard();
|
||||
|
||||
ImGui::Text("Dear ImGui %s (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM);
|
||||
ImGui::Separator();
|
||||
ImGui::Text("sizeof(size_t): %d, sizeof(ImDrawIdx): %d, sizeof(ImDrawVert): %d", (int)sizeof(size_t), (int)sizeof(ImDrawIdx), (int)sizeof(ImDrawVert));
|
||||
ImGui::Text("define: __cplusplus=%d", (int)__cplusplus);
|
||||
Text("Dear ImGui %s (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM);
|
||||
Separator();
|
||||
Text("sizeof(size_t): %d, sizeof(ImDrawIdx): %d, sizeof(ImDrawVert): %d", (int)sizeof(size_t), (int)sizeof(ImDrawIdx), (int)sizeof(ImDrawVert));
|
||||
Text("define: __cplusplus=%d", (int)__cplusplus);
|
||||
#ifdef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
ImGui::Text("define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS");
|
||||
#endif
|
||||
@@ -2930,10 +2930,10 @@ void ImGui::ShowAboutWindow(bool* p_open)
|
||||
ImGui::Text("define: IMGUI_USE_BGRA_PACKED_COLOR");
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
ImGui::Text("define: _WIN32");
|
||||
Text("define: _WIN32");
|
||||
#endif
|
||||
#ifdef _WIN64
|
||||
ImGui::Text("define: _WIN64");
|
||||
Text("define: _WIN64");
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
ImGui::Text("define: __linux__");
|
||||
@@ -2942,7 +2942,7 @@ void ImGui::ShowAboutWindow(bool* p_open)
|
||||
ImGui::Text("define: __APPLE__");
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
ImGui::Text("define: _MSC_VER=%d", _MSC_VER);
|
||||
Text("define: _MSC_VER=%d", _MSC_VER);
|
||||
#endif
|
||||
#ifdef __MINGW32__
|
||||
ImGui::Text("define: __MINGW32__");
|
||||
@@ -2956,44 +2956,44 @@ void ImGui::ShowAboutWindow(bool* p_open)
|
||||
#ifdef __clang_version__
|
||||
ImGui::Text("define: __clang_version__=%s", __clang_version__);
|
||||
#endif
|
||||
ImGui::Separator();
|
||||
ImGui::Text("io.BackendPlatformName: %s", io.BackendPlatformName ? io.BackendPlatformName : "NULL");
|
||||
ImGui::Text("io.BackendRendererName: %s", io.BackendRendererName ? io.BackendRendererName : "NULL");
|
||||
ImGui::Text("io.ConfigFlags: 0x%08X", io.ConfigFlags);
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) ImGui::Text(" NavEnableKeyboard");
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) ImGui::Text(" NavEnableGamepad");
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) ImGui::Text(" NavEnableSetMousePos");
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard) ImGui::Text(" NavNoCaptureKeyboard");
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_NoMouse) ImGui::Text(" NoMouse");
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) ImGui::Text(" NoMouseCursorChange");
|
||||
if (io.MouseDrawCursor) ImGui::Text("io.MouseDrawCursor");
|
||||
if (io.ConfigMacOSXBehaviors) ImGui::Text("io.ConfigMacOSXBehaviors");
|
||||
if (io.ConfigInputTextCursorBlink) ImGui::Text("io.ConfigInputTextCursorBlink");
|
||||
if (io.ConfigWindowsResizeFromEdges) ImGui::Text("io.ConfigWindowsResizeFromEdges");
|
||||
if (io.ConfigWindowsMoveFromTitleBarOnly) ImGui::Text("io.ConfigWindowsMoveFromTitleBarOnly");
|
||||
ImGui::Text("io.BackendFlags: 0x%08X", io.BackendFlags);
|
||||
if (io.BackendFlags & ImGuiBackendFlags_HasGamepad) ImGui::Text(" HasGamepad");
|
||||
if (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) ImGui::Text(" HasMouseCursors");
|
||||
if (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos) ImGui::Text(" HasSetMousePos");
|
||||
if (io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset) ImGui::Text(" RendererHasVtxOffset");
|
||||
ImGui::Separator();
|
||||
ImGui::Text("io.Fonts: %d fonts, Flags: 0x%08X, TexSize: %d,%d", io.Fonts->Fonts.Size, io.Fonts->Flags, io.Fonts->TexWidth, io.Fonts->TexHeight);
|
||||
ImGui::Text("io.DisplaySize: %.2f,%.2f", io.DisplaySize.x, io.DisplaySize.y);
|
||||
ImGui::Text("io.DisplayFramebufferScale: %.2f,%.2f", io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y);
|
||||
ImGui::Separator();
|
||||
ImGui::Text("style.WindowPadding: %.2f,%.2f", style.WindowPadding.x, style.WindowPadding.y);
|
||||
ImGui::Text("style.WindowBorderSize: %.2f", style.WindowBorderSize);
|
||||
ImGui::Text("style.FramePadding: %.2f,%.2f", style.FramePadding.x, style.FramePadding.y);
|
||||
ImGui::Text("style.FrameRounding: %.2f", style.FrameRounding);
|
||||
ImGui::Text("style.FrameBorderSize: %.2f", style.FrameBorderSize);
|
||||
ImGui::Text("style.ItemSpacing: %.2f,%.2f", style.ItemSpacing.x, style.ItemSpacing.y);
|
||||
ImGui::Text("style.ItemInnerSpacing: %.2f,%.2f", style.ItemInnerSpacing.x, style.ItemInnerSpacing.y);
|
||||
Separator();
|
||||
Text("io.BackendPlatformName: %s", io.BackendPlatformName ? io.BackendPlatformName : "NULL");
|
||||
Text("io.BackendRendererName: %s", io.BackendRendererName ? io.BackendRendererName : "NULL");
|
||||
Text("io.ConfigFlags: 0x%08X", io.ConfigFlags);
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) Text(" NavEnableKeyboard");
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) Text(" NavEnableGamepad");
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) Text(" NavEnableSetMousePos");
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard) Text(" NavNoCaptureKeyboard");
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_NoMouse) Text(" NoMouse");
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_NoMouseCursorChange) Text(" NoMouseCursorChange");
|
||||
if (io.MouseDrawCursor) Text("io.MouseDrawCursor");
|
||||
if (io.ConfigMacOSXBehaviors) Text("io.ConfigMacOSXBehaviors");
|
||||
if (io.ConfigInputTextCursorBlink) Text("io.ConfigInputTextCursorBlink");
|
||||
if (io.ConfigWindowsResizeFromEdges) Text("io.ConfigWindowsResizeFromEdges");
|
||||
if (io.ConfigWindowsMoveFromTitleBarOnly) Text("io.ConfigWindowsMoveFromTitleBarOnly");
|
||||
Text("io.BackendFlags: 0x%08X", io.BackendFlags);
|
||||
if (io.BackendFlags & ImGuiBackendFlags_HasGamepad) Text(" HasGamepad");
|
||||
if (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) Text(" HasMouseCursors");
|
||||
if (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos) Text(" HasSetMousePos");
|
||||
if (io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset) Text(" RendererHasVtxOffset");
|
||||
Separator();
|
||||
Text("io.Fonts: %d fonts, Flags: 0x%08X, TexSize: %d,%d", io.Fonts->Fonts.Size, io.Fonts->Flags, io.Fonts->TexWidth, io.Fonts->TexHeight);
|
||||
Text("io.DisplaySize: %.2f,%.2f", io.DisplaySize.x, io.DisplaySize.y);
|
||||
Text("io.DisplayFramebufferScale: %.2f,%.2f", io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y);
|
||||
Separator();
|
||||
Text("style.WindowPadding: %.2f,%.2f", style.WindowPadding.x, style.WindowPadding.y);
|
||||
Text("style.WindowBorderSize: %.2f", style.WindowBorderSize);
|
||||
Text("style.FramePadding: %.2f,%.2f", style.FramePadding.x, style.FramePadding.y);
|
||||
Text("style.FrameRounding: %.2f", style.FrameRounding);
|
||||
Text("style.FrameBorderSize: %.2f", style.FrameBorderSize);
|
||||
Text("style.ItemSpacing: %.2f,%.2f", style.ItemSpacing.x, style.ItemSpacing.y);
|
||||
Text("style.ItemInnerSpacing: %.2f,%.2f", style.ItemInnerSpacing.x, style.ItemInnerSpacing.y);
|
||||
|
||||
if (copy_to_clipboard)
|
||||
ImGui::LogFinish();
|
||||
ImGui::EndChildFrame();
|
||||
LogFinish();
|
||||
EndChildFrame();
|
||||
}
|
||||
ImGui::End();
|
||||
End();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -3005,13 +3005,13 @@ void ImGui::ShowAboutWindow(bool* p_open)
|
||||
bool ImGui::ShowStyleSelector(const char* label)
|
||||
{
|
||||
static int style_idx = -1;
|
||||
if (ImGui::Combo(label, &style_idx, "Classic\0Dark\0Light\0"))
|
||||
if (Combo(label, &style_idx, "Classic\0Dark\0Light\0"))
|
||||
{
|
||||
switch (style_idx)
|
||||
{
|
||||
case 0: ImGui::StyleColorsClassic(); break;
|
||||
case 1: ImGui::StyleColorsDark(); break;
|
||||
case 2: ImGui::StyleColorsLight(); break;
|
||||
case 0: StyleColorsClassic(); break;
|
||||
case 1: StyleColorsDark(); break;
|
||||
case 2: StyleColorsLight(); break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -3022,21 +3022,21 @@ bool ImGui::ShowStyleSelector(const char* label)
|
||||
// Here we use the regular BeginCombo()/EndCombo() api which is more the more flexible one.
|
||||
void ImGui::ShowFontSelector(const char* label)
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
const ImFont * font_current = ImGui::GetFont();
|
||||
if (ImGui::BeginCombo(label, font_current->GetDebugName()))
|
||||
ImGuiIO& io = GetIO();
|
||||
const ImFont * font_current = GetFont();
|
||||
if (BeginCombo(label, font_current->GetDebugName()))
|
||||
{
|
||||
for (int n = 0; n < io.Fonts->Fonts.Size; n++)
|
||||
{
|
||||
ImFont* font = io.Fonts->Fonts[n];
|
||||
ImGui::PushID((void*)font);
|
||||
if (ImGui::Selectable(font->GetDebugName(), font == font_current))
|
||||
PushID((void*)font);
|
||||
if (Selectable(font->GetDebugName(), font == font_current))
|
||||
io.FontDefault = font;
|
||||
ImGui::PopID();
|
||||
PopID();
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
EndCombo();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
SameLine();
|
||||
HelpMarker(
|
||||
"- Load additional fonts with io.Fonts->AddFontFromFileTTF().\n"
|
||||
"- The font atlas is built when calling io.Fonts->GetTexDataAsXXXX() or io.Fonts->Build().\n"
|
||||
@@ -3047,7 +3047,7 @@ void ImGui::ShowFontSelector(const char* label)
|
||||
void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
{
|
||||
// You can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it compares to an internally stored reference)
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
ImGuiStyle& style = GetStyle();
|
||||
static ImGuiStyle ref_saved_style;
|
||||
|
||||
// Default to using internal storage as reference
|
||||
@@ -3058,155 +3058,155 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
if (ref == NULL)
|
||||
ref = &ref_saved_style;
|
||||
|
||||
ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.50f);
|
||||
PushItemWidth(GetWindowWidth() * 0.50f);
|
||||
|
||||
if (ImGui::ShowStyleSelector("Colors##Selector"))
|
||||
if (ShowStyleSelector("Colors##Selector"))
|
||||
ref_saved_style = style;
|
||||
ImGui::ShowFontSelector("Fonts##Selector");
|
||||
ShowFontSelector("Fonts##Selector");
|
||||
|
||||
// Simplified Settings
|
||||
if (ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f"))
|
||||
if (SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f"))
|
||||
style.GrabRounding = style.FrameRounding; // Make GrabRounding always the same value as FrameRounding
|
||||
{ bool window_border = (style.WindowBorderSize > 0.0f); if (ImGui::Checkbox("WindowBorder", &window_border)) style.WindowBorderSize = window_border ? 1.0f : 0.0f; }
|
||||
ImGui::SameLine();
|
||||
{ bool frame_border = (style.FrameBorderSize > 0.0f); if (ImGui::Checkbox("FrameBorder", &frame_border)) style.FrameBorderSize = frame_border ? 1.0f : 0.0f; }
|
||||
ImGui::SameLine();
|
||||
{ bool popup_border = (style.PopupBorderSize > 0.0f); if (ImGui::Checkbox("PopupBorder", &popup_border)) style.PopupBorderSize = popup_border ? 1.0f : 0.0f; }
|
||||
{ bool window_border = (style.WindowBorderSize > 0.0f); if (Checkbox("WindowBorder", &window_border)) style.WindowBorderSize = window_border ? 1.0f : 0.0f; }
|
||||
SameLine();
|
||||
{ bool frame_border = (style.FrameBorderSize > 0.0f); if (Checkbox("FrameBorder", &frame_border)) style.FrameBorderSize = frame_border ? 1.0f : 0.0f; }
|
||||
SameLine();
|
||||
{ bool popup_border = (style.PopupBorderSize > 0.0f); if (Checkbox("PopupBorder", &popup_border)) style.PopupBorderSize = popup_border ? 1.0f : 0.0f; }
|
||||
|
||||
// Save/Revert button
|
||||
if (ImGui::Button("Save Ref"))
|
||||
if (Button("Save Ref"))
|
||||
*ref = ref_saved_style = style;
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Revert Ref"))
|
||||
SameLine();
|
||||
if (Button("Revert Ref"))
|
||||
style = *ref;
|
||||
ImGui::SameLine();
|
||||
SameLine();
|
||||
HelpMarker("Save/Revert in local non-persistent storage. Default Colors definition are not affected. Use \"Export Colors\" below to save them somewhere.");
|
||||
|
||||
ImGui::Separator();
|
||||
Separator();
|
||||
|
||||
if (ImGui::BeginTabBar("##tabs", ImGuiTabBarFlags_None))
|
||||
if (BeginTabBar("##tabs", ImGuiTabBarFlags_None))
|
||||
{
|
||||
if (ImGui::BeginTabItem("Sizes"))
|
||||
if (BeginTabItem("Sizes"))
|
||||
{
|
||||
ImGui::Text("Main");
|
||||
ImGui::SliderFloat2("WindowPadding", (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f");
|
||||
ImGui::SliderFloat2("FramePadding", (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f");
|
||||
ImGui::SliderFloat2("ItemSpacing", (float*)&style.ItemSpacing, 0.0f, 20.0f, "%.0f");
|
||||
ImGui::SliderFloat2("ItemInnerSpacing", (float*)&style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f");
|
||||
ImGui::SliderFloat2("TouchExtraPadding", (float*)&style.TouchExtraPadding, 0.0f, 10.0f, "%.0f");
|
||||
ImGui::SliderFloat("IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f, "%.0f");
|
||||
ImGui::SliderFloat("ScrollbarSize", &style.ScrollbarSize, 1.0f, 20.0f, "%.0f");
|
||||
ImGui::SliderFloat("GrabMinSize", &style.GrabMinSize, 1.0f, 20.0f, "%.0f");
|
||||
ImGui::Text("Borders");
|
||||
ImGui::SliderFloat("WindowBorderSize", &style.WindowBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
ImGui::SliderFloat("ChildBorderSize", &style.ChildBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
ImGui::SliderFloat("PopupBorderSize", &style.PopupBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
ImGui::SliderFloat("FrameBorderSize", &style.FrameBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
ImGui::SliderFloat("TabBorderSize", &style.TabBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
ImGui::Text("Rounding");
|
||||
ImGui::SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::SliderFloat("ChildRounding", &style.ChildRounding, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::SliderFloat("PopupRounding", &style.PopupRounding, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::SliderFloat("ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::SliderFloat("TabRounding", &style.TabRounding, 0.0f, 12.0f, "%.0f");
|
||||
ImGui::Text("Alignment");
|
||||
ImGui::SliderFloat2("WindowTitleAlign", (float*)&style.WindowTitleAlign, 0.0f, 1.0f, "%.2f");
|
||||
ImGui::Combo("WindowMenuButtonPosition", (int*)&style.WindowMenuButtonPosition, "Left\0Right\0");
|
||||
ImGui::SliderFloat2("ButtonTextAlign", (float*)&style.ButtonTextAlign, 0.0f, 1.0f, "%.2f"); ImGui::SameLine(); HelpMarker("Alignment applies when a button is larger than its text content.");
|
||||
ImGui::SliderFloat2("SelectableTextAlign", (float*)&style.SelectableTextAlign, 0.0f, 1.0f, "%.2f"); ImGui::SameLine(); HelpMarker("Alignment applies when a selectable is larger than its text content.");
|
||||
ImGui::Text("Safe Area Padding"); ImGui::SameLine(); HelpMarker("Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured).");
|
||||
ImGui::SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f");
|
||||
ImGui::EndTabItem();
|
||||
Text("Main");
|
||||
SliderFloat2("WindowPadding", (float*)&style.WindowPadding, 0.0f, 20.0f, "%.0f");
|
||||
SliderFloat2("FramePadding", (float*)&style.FramePadding, 0.0f, 20.0f, "%.0f");
|
||||
SliderFloat2("ItemSpacing", (float*)&style.ItemSpacing, 0.0f, 20.0f, "%.0f");
|
||||
SliderFloat2("ItemInnerSpacing", (float*)&style.ItemInnerSpacing, 0.0f, 20.0f, "%.0f");
|
||||
SliderFloat2("TouchExtraPadding", (float*)&style.TouchExtraPadding, 0.0f, 10.0f, "%.0f");
|
||||
SliderFloat("IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f, "%.0f");
|
||||
SliderFloat("ScrollbarSize", &style.ScrollbarSize, 1.0f, 20.0f, "%.0f");
|
||||
SliderFloat("GrabMinSize", &style.GrabMinSize, 1.0f, 20.0f, "%.0f");
|
||||
Text("Borders");
|
||||
SliderFloat("WindowBorderSize", &style.WindowBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
SliderFloat("ChildBorderSize", &style.ChildBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
SliderFloat("PopupBorderSize", &style.PopupBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
SliderFloat("FrameBorderSize", &style.FrameBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
SliderFloat("TabBorderSize", &style.TabBorderSize, 0.0f, 1.0f, "%.0f");
|
||||
Text("Rounding");
|
||||
SliderFloat("WindowRounding", &style.WindowRounding, 0.0f, 12.0f, "%.0f");
|
||||
SliderFloat("ChildRounding", &style.ChildRounding, 0.0f, 12.0f, "%.0f");
|
||||
SliderFloat("FrameRounding", &style.FrameRounding, 0.0f, 12.0f, "%.0f");
|
||||
SliderFloat("PopupRounding", &style.PopupRounding, 0.0f, 12.0f, "%.0f");
|
||||
SliderFloat("ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 12.0f, "%.0f");
|
||||
SliderFloat("GrabRounding", &style.GrabRounding, 0.0f, 12.0f, "%.0f");
|
||||
SliderFloat("TabRounding", &style.TabRounding, 0.0f, 12.0f, "%.0f");
|
||||
Text("Alignment");
|
||||
SliderFloat2("WindowTitleAlign", (float*)&style.WindowTitleAlign, 0.0f, 1.0f, "%.2f");
|
||||
Combo("WindowMenuButtonPosition", (int*)&style.WindowMenuButtonPosition, "Left\0Right\0");
|
||||
SliderFloat2("ButtonTextAlign", (float*)&style.ButtonTextAlign, 0.0f, 1.0f, "%.2f"); 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.");
|
||||
Text("Safe Area Padding"); SameLine(); HelpMarker("Adjust if you cannot see the edges of your screen (e.g. on a TV where scaling has not been configured).");
|
||||
SliderFloat2("DisplaySafeAreaPadding", (float*)&style.DisplaySafeAreaPadding, 0.0f, 30.0f, "%.0f");
|
||||
EndTabItem();
|
||||
}
|
||||
|
||||
if (ImGui::BeginTabItem("Colors"))
|
||||
if (BeginTabItem("Colors"))
|
||||
{
|
||||
static int output_dest = 0;
|
||||
static bool output_only_modified = true;
|
||||
if (ImGui::Button("Export Unsaved"))
|
||||
if (Button("Export Unsaved"))
|
||||
{
|
||||
if (output_dest == 0)
|
||||
ImGui::LogToClipboard();
|
||||
LogToClipboard();
|
||||
else
|
||||
ImGui::LogToTTY();
|
||||
ImGui::LogText("ImVec4* colors = ImGui::GetStyle().Colors;" IM_NEWLINE);
|
||||
LogToTTY();
|
||||
LogText("ImVec4* colors = ImGui::GetStyle().Colors;" IM_NEWLINE);
|
||||
for (int i = 0; i < ImGuiCol_COUNT; i++)
|
||||
{
|
||||
const ImVec4& col = style.Colors[i];
|
||||
const char* name = ImGui::GetStyleColorName(i);
|
||||
const char* name = GetStyleColorName(i);
|
||||
if (!output_only_modified || memcmp(&col, &ref->Colors[i], sizeof(ImVec4)) != 0)
|
||||
ImGui::LogText("colors[ImGuiCol_%s]%*s= ImVec4(%.2ff, %.2ff, %.2ff, %.2ff);" IM_NEWLINE, name, 23 - (int)strlen(name), "", col.x, col.y, col.z, col.w);
|
||||
LogText("colors[ImGuiCol_%s]%*s= ImVec4(%.2ff, %.2ff, %.2ff, %.2ff);" IM_NEWLINE, name, 23 - (int)strlen(name), "", col.x, col.y, col.z, col.w);
|
||||
}
|
||||
ImGui::LogFinish();
|
||||
LogFinish();
|
||||
}
|
||||
ImGui::SameLine(); ImGui::SetNextItemWidth(120); ImGui::Combo("##output_type", &output_dest, "To Clipboard\0To TTY\0");
|
||||
ImGui::SameLine(); ImGui::Checkbox("Only Modified Colors", &output_only_modified);
|
||||
SameLine(); SetNextItemWidth(120); Combo("##output_type", &output_dest, "To Clipboard\0To TTY\0");
|
||||
SameLine(); Checkbox("Only Modified Colors", &output_only_modified);
|
||||
|
||||
static ImGuiTextFilter filter;
|
||||
filter.Draw("Filter colors", ImGui::GetFontSize() * 16);
|
||||
filter.Draw("Filter colors", GetFontSize() * 16);
|
||||
|
||||
static ImGuiColorEditFlags alpha_flags = 0;
|
||||
ImGui::RadioButton("Opaque", &alpha_flags, 0); ImGui::SameLine();
|
||||
ImGui::RadioButton("Alpha", &alpha_flags, ImGuiColorEditFlags_AlphaPreview); ImGui::SameLine();
|
||||
ImGui::RadioButton("Both", &alpha_flags, ImGuiColorEditFlags_AlphaPreviewHalf); ImGui::SameLine();
|
||||
RadioButton("Opaque", &alpha_flags, 0); SameLine();
|
||||
RadioButton("Alpha", &alpha_flags, ImGuiColorEditFlags_AlphaPreview); SameLine();
|
||||
RadioButton("Both", &alpha_flags, ImGuiColorEditFlags_AlphaPreviewHalf); SameLine();
|
||||
HelpMarker("In the color list:\nLeft-click on colored square to open color picker,\nRight-click to open edit options menu.");
|
||||
|
||||
ImGui::BeginChild("##colors", ImVec2(0, 0), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened);
|
||||
ImGui::PushItemWidth(-160);
|
||||
BeginChild("##colors", ImVec2(0, 0), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened);
|
||||
PushItemWidth(-160);
|
||||
for (int i = 0; i < ImGuiCol_COUNT; i++)
|
||||
{
|
||||
const char* name = ImGui::GetStyleColorName(i);
|
||||
const char* name = GetStyleColorName(i);
|
||||
if (!filter.PassFilter(name))
|
||||
continue;
|
||||
ImGui::PushID(i);
|
||||
ImGui::ColorEdit4("##color", (float*)&style.Colors[i], ImGuiColorEditFlags_AlphaBar | alpha_flags);
|
||||
PushID(i);
|
||||
ColorEdit4("##color", (float*)&style.Colors[i], ImGuiColorEditFlags_AlphaBar | alpha_flags);
|
||||
if (memcmp(&style.Colors[i], &ref->Colors[i], sizeof(ImVec4)) != 0)
|
||||
{
|
||||
// Tips: in a real user application, you may want to merge and use an icon font into the main font, so instead of "Save"/"Revert" you'd use icons.
|
||||
// Read the FAQ and misc/fonts/README.txt about using icon fonts. It's really easy and super convenient!
|
||||
ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); if (ImGui::Button("Save")) ref->Colors[i] = style.Colors[i];
|
||||
ImGui::SameLine(0.0f, style.ItemInnerSpacing.x); if (ImGui::Button("Revert")) style.Colors[i] = ref->Colors[i];
|
||||
SameLine(0.0f, style.ItemInnerSpacing.x); if (Button("Save")) ref->Colors[i] = style.Colors[i];
|
||||
SameLine(0.0f, style.ItemInnerSpacing.x); if (Button("Revert")) style.Colors[i] = ref->Colors[i];
|
||||
}
|
||||
ImGui::SameLine(0.0f, style.ItemInnerSpacing.x);
|
||||
ImGui::TextUnformatted(name);
|
||||
ImGui::PopID();
|
||||
SameLine(0.0f, style.ItemInnerSpacing.x);
|
||||
TextUnformatted(name);
|
||||
PopID();
|
||||
}
|
||||
ImGui::PopItemWidth();
|
||||
ImGui::EndChild();
|
||||
PopItemWidth();
|
||||
EndChild();
|
||||
|
||||
ImGui::EndTabItem();
|
||||
EndTabItem();
|
||||
}
|
||||
|
||||
if (ImGui::BeginTabItem("Fonts"))
|
||||
if (BeginTabItem("Fonts"))
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
ImGuiIO& io = GetIO();
|
||||
ImFontAtlas* atlas = io.Fonts;
|
||||
HelpMarker("Read FAQ and misc/fonts/README.txt for details on font loading.");
|
||||
ImGui::PushItemWidth(120);
|
||||
PushItemWidth(120);
|
||||
for (int i = 0; i < atlas->Fonts.Size; i++)
|
||||
{
|
||||
ImFont* font = atlas->Fonts[i];
|
||||
ImGui::PushID(font);
|
||||
const bool font_details_opened = ImGui::TreeNode(font, "Font %d: \"%s\"\n%.2f px, %d glyphs, %d file(s)", i, font->ConfigData ? font->ConfigData[0].Name : "", font->FontSize, font->Glyphs.Size, font->ConfigDataCount);
|
||||
ImGui::SameLine(); if (ImGui::SmallButton("Set as default")) { io.FontDefault = font; }
|
||||
PushID(font);
|
||||
const bool font_details_opened = TreeNode(font, "Font %d: \"%s\"\n%.2f px, %d glyphs, %d file(s)", i, font->ConfigData ? font->ConfigData[0].Name : "", font->FontSize, font->Glyphs.Size, font->ConfigDataCount);
|
||||
SameLine(); if (SmallButton("Set as default")) { io.FontDefault = font; }
|
||||
if (font_details_opened)
|
||||
{
|
||||
ImGui::PushFont(font);
|
||||
ImGui::Text("The quick brown fox jumps over the lazy dog");
|
||||
ImGui::PopFont();
|
||||
ImGui::DragFloat("Font scale", &font->Scale, 0.005f, 0.3f, 2.0f, "%.1f"); // Scale only this font
|
||||
ImGui::SameLine(); HelpMarker("Note than the default embedded font is NOT meant to be scaled.\n\nFont are currently rendered into bitmaps at a given size at the time of building the atlas. You may oversample them to get some flexibility with scaling. You can also render at multiple sizes and select which one to use at runtime.\n\n(Glimmer of hope: the atlas system should hopefully be rewritten in the future to make scaling more natural and automatic.)");
|
||||
ImGui::InputFloat("Font offset", &font->DisplayOffset.y, 1, 1, "%.0f");
|
||||
ImGui::Text("Ascent: %f, Descent: %f, Height: %f", font->Ascent, font->Descent, font->Ascent - font->Descent);
|
||||
ImGui::Text("Fallback character: '%c' (%d)", font->FallbackChar, font->FallbackChar);
|
||||
PushFont(font);
|
||||
Text("The quick brown fox jumps over the lazy dog");
|
||||
PopFont();
|
||||
DragFloat("Font scale", &font->Scale, 0.005f, 0.3f, 2.0f, "%.1f"); // Scale only this font
|
||||
SameLine(); HelpMarker("Note than the default embedded font is NOT meant to be scaled.\n\nFont are currently rendered into bitmaps at a given size at the time of building the atlas. You may oversample them to get some flexibility with scaling. You can also render at multiple sizes and select which one to use at runtime.\n\n(Glimmer of hope: the atlas system should hopefully be rewritten in the future to make scaling more natural and automatic.)");
|
||||
InputFloat("Font offset", &font->DisplayOffset.y, 1, 1, "%.0f");
|
||||
Text("Ascent: %f, Descent: %f, Height: %f", font->Ascent, font->Descent, font->Ascent - font->Descent);
|
||||
Text("Fallback character: '%c' (%d)", font->FallbackChar, font->FallbackChar);
|
||||
const float surface_sqrt = sqrtf((float)font->MetricsTotalSurface);
|
||||
ImGui::Text("Texture surface: %d pixels (approx) ~ %dx%d", font->MetricsTotalSurface, (int)surface_sqrt, (int)surface_sqrt);
|
||||
Text("Texture surface: %d pixels (approx) ~ %dx%d", font->MetricsTotalSurface, (int)surface_sqrt, (int)surface_sqrt);
|
||||
for (int config_i = 0; config_i < font->ConfigDataCount; config_i++)
|
||||
if (const ImFontConfig* cfg = &font->ConfigData[config_i])
|
||||
ImGui::BulletText("Input %d: \'%s\', Oversample: (%d,%d), PixelSnapH: %d", config_i, cfg->Name, cfg->OversampleH, cfg->OversampleV, cfg->PixelSnapH);
|
||||
if (ImGui::TreeNode("Glyphs", "Glyphs (%d)", font->Glyphs.Size))
|
||||
BulletText("Input %d: \'%s\', Oversample: (%d,%d), PixelSnapH: %d", config_i, cfg->Name, cfg->OversampleH, cfg->OversampleV, cfg->PixelSnapH);
|
||||
if (TreeNode("Glyphs", "Glyphs (%d)", font->Glyphs.Size))
|
||||
{
|
||||
// Display all glyphs of the fonts in separate pages of 256 characters
|
||||
for (int base = 0; base < 0x10000; base += 256)
|
||||
@@ -3214,12 +3214,12 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
int count = 0;
|
||||
for (int n = 0; n < 256; n++)
|
||||
count += font->FindGlyphNoFallback((ImWchar)(base + n)) ? 1 : 0;
|
||||
if (count > 0 && ImGui::TreeNode((void*)(intptr_t)base, "U+%04X..U+%04X (%d %s)", base, base + 255, count, count > 1 ? "glyphs" : "glyph"))
|
||||
if (count > 0 && TreeNode((void*)(intptr_t)base, "U+%04X..U+%04X (%d %s)", base, base + 255, count, count > 1 ? "glyphs" : "glyph"))
|
||||
{
|
||||
const float cell_size = font->FontSize * 1;
|
||||
const float cell_spacing = style.ItemSpacing.y;
|
||||
const ImVec2 base_pos = ImGui::GetCursorScreenPos();
|
||||
ImDrawList* draw_list = ImGui::GetWindowDrawList();
|
||||
const ImVec2 base_pos = GetCursorScreenPos();
|
||||
ImDrawList* draw_list = GetWindowDrawList();
|
||||
for (int n = 0; n < 256; n++)
|
||||
{
|
||||
ImVec2 cell_p1(base_pos.x + (n % 16) * (cell_size + cell_spacing), base_pos.y + (n / 16) * (cell_size + cell_spacing));
|
||||
@@ -3227,62 +3227,62 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
|
||||
const ImFontGlyph* glyph = font->FindGlyphNoFallback((ImWchar)(base + n));
|
||||
draw_list->AddRect(cell_p1, cell_p2, glyph ? IM_COL32(255, 255, 255, 100) : IM_COL32(255, 255, 255, 50));
|
||||
if (glyph)
|
||||
font->RenderChar(draw_list, cell_size, cell_p1, ImGui::GetColorU32(ImGuiCol_Text), (ImWchar)(base + n)); // We use ImFont::RenderChar as a shortcut because we don't have UTF-8 conversion functions available to generate a string.
|
||||
if (glyph && ImGui::IsMouseHoveringRect(cell_p1, cell_p2))
|
||||
font->RenderChar(draw_list, cell_size, cell_p1, GetColorU32(ImGuiCol_Text), (ImWchar)(base + n)); // We use ImFont::RenderChar as a shortcut because we don't have UTF-8 conversion functions available to generate a string.
|
||||
if (glyph && IsMouseHoveringRect(cell_p1, cell_p2))
|
||||
{
|
||||
ImGui::BeginTooltip();
|
||||
ImGui::Text("Codepoint: U+%04X", base + n);
|
||||
ImGui::Separator();
|
||||
ImGui::Text("AdvanceX: %.1f", glyph->AdvanceX);
|
||||
ImGui::Text("Pos: (%.2f,%.2f)->(%.2f,%.2f)", glyph->X0, glyph->Y0, glyph->X1, glyph->Y1);
|
||||
ImGui::Text("UV: (%.3f,%.3f)->(%.3f,%.3f)", glyph->U0, glyph->V0, glyph->U1, glyph->V1);
|
||||
ImGui::EndTooltip();
|
||||
BeginTooltip();
|
||||
Text("Codepoint: U+%04X", base + n);
|
||||
Separator();
|
||||
Text("AdvanceX: %.1f", glyph->AdvanceX);
|
||||
Text("Pos: (%.2f,%.2f)->(%.2f,%.2f)", glyph->X0, glyph->Y0, glyph->X1, glyph->Y1);
|
||||
Text("UV: (%.3f,%.3f)->(%.3f,%.3f)", glyph->U0, glyph->V0, glyph->U1, glyph->V1);
|
||||
EndTooltip();
|
||||
}
|
||||
}
|
||||
ImGui::Dummy(ImVec2((cell_size + cell_spacing) * 16, (cell_size + cell_spacing) * 16));
|
||||
ImGui::TreePop();
|
||||
Dummy(ImVec2((cell_size + cell_spacing) * 16, (cell_size + cell_spacing) * 16));
|
||||
TreePop();
|
||||
}
|
||||
}
|
||||
ImGui::TreePop();
|
||||
TreePop();
|
||||
}
|
||||
ImGui::TreePop();
|
||||
TreePop();
|
||||
}
|
||||
ImGui::PopID();
|
||||
PopID();
|
||||
}
|
||||
if (ImGui::TreeNode("Atlas texture", "Atlas texture (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight))
|
||||
if (TreeNode("Atlas texture", "Atlas texture (%dx%d pixels)", atlas->TexWidth, atlas->TexHeight))
|
||||
{
|
||||
const auto tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
const auto border_col = ImVec4(1.0f, 1.0f, 1.0f, 0.5f);
|
||||
ImGui::Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0, 0), ImVec2(1, 1), tint_col, border_col);
|
||||
ImGui::TreePop();
|
||||
Image(atlas->TexID, ImVec2((float)atlas->TexWidth, (float)atlas->TexHeight), ImVec2(0, 0), ImVec2(1, 1), tint_col, border_col);
|
||||
TreePop();
|
||||
}
|
||||
|
||||
static float window_scale = 1.0f;
|
||||
if (ImGui::DragFloat("this window scale", &window_scale, 0.005f, 0.3f, 2.0f, "%.2f")) // scale only this window
|
||||
ImGui::SetWindowFontScale(window_scale);
|
||||
ImGui::DragFloat("global scale", &io.FontGlobalScale, 0.005f, 0.3f, 2.0f, "%.2f"); // scale everything
|
||||
ImGui::PopItemWidth();
|
||||
if (DragFloat("this window scale", &window_scale, 0.005f, 0.3f, 2.0f, "%.2f")) // scale only this window
|
||||
SetWindowFontScale(window_scale);
|
||||
DragFloat("global scale", &io.FontGlobalScale, 0.005f, 0.3f, 2.0f, "%.2f"); // scale everything
|
||||
PopItemWidth();
|
||||
|
||||
ImGui::EndTabItem();
|
||||
EndTabItem();
|
||||
}
|
||||
|
||||
if (ImGui::BeginTabItem("Rendering"))
|
||||
if (BeginTabItem("Rendering"))
|
||||
{
|
||||
ImGui::Checkbox("Anti-aliased lines", &style.AntiAliasedLines); ImGui::SameLine(); HelpMarker("When disabling anti-aliasing lines, you'll probably want to disable borders in your style as well.");
|
||||
ImGui::Checkbox("Anti-aliased fill", &style.AntiAliasedFill);
|
||||
ImGui::PushItemWidth(100);
|
||||
ImGui::DragFloat("Curve Tessellation Tolerance", &style.CurveTessellationTol, 0.02f, 0.10f, FLT_MAX, "%.2f", 2.0f);
|
||||
Checkbox("Anti-aliased lines", &style.AntiAliasedLines); SameLine(); HelpMarker("When disabling anti-aliasing lines, you'll probably want to disable borders in your style as well.");
|
||||
Checkbox("Anti-aliased fill", &style.AntiAliasedFill);
|
||||
PushItemWidth(100);
|
||||
DragFloat("Curve Tessellation Tolerance", &style.CurveTessellationTol, 0.02f, 0.10f, FLT_MAX, "%.2f", 2.0f);
|
||||
if (style.CurveTessellationTol < 0.10f) style.CurveTessellationTol = 0.10f;
|
||||
ImGui::DragFloat("Global Alpha", &style.Alpha, 0.005f, 0.20f, 1.0f, "%.2f"); // Not exposing zero here so user doesn't "lose" the UI (zero alpha clips all widgets). But application code could have a toggle to switch between zero and non-zero.
|
||||
ImGui::PopItemWidth();
|
||||
DragFloat("Global Alpha", &style.Alpha, 0.005f, 0.20f, 1.0f, "%.2f"); // Not exposing zero here so user doesn't "lose" the UI (zero alpha clips all widgets). But application code could have a toggle to switch between zero and non-zero.
|
||||
PopItemWidth();
|
||||
|
||||
ImGui::EndTabItem();
|
||||
EndTabItem();
|
||||
}
|
||||
|
||||
ImGui::EndTabBar();
|
||||
EndTabBar();
|
||||
}
|
||||
|
||||
ImGui::PopItemWidth();
|
||||
PopItemWidth();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user