InputText: added ImGuiInputTextFlags_ElideLeft. (#1442, #1440, #4391, #7208, #8216)

This commit is contained in:
ocornut
2024-12-09 14:31:28 +01:00
parent d2645423de
commit d78e823449
4 changed files with 32 additions and 7 deletions

View File

@@ -1830,6 +1830,16 @@ static void ShowDemoWindowWidgets(ImGuiDemoWindowData* demo_data)
ImGui::TreePop();
}
IMGUI_DEMO_MARKER("Widgets/Text Input/Eliding, Alignment");
if (ImGui::TreeNode("Eliding, Alignment"))
{
static char buf1[128] = "/path/to/some/folder/with/long/filename.cpp";
static ImGuiInputTextFlags flags = ImGuiInputTextFlags_ElideLeft;
ImGui::CheckboxFlags("ImGuiInputTextFlags_ElideLeft", &flags, ImGuiInputTextFlags_ElideLeft);
ImGui::InputText("Path", buf1, IM_ARRAYSIZE(buf1), flags);
ImGui::TreePop();
}
IMGUI_DEMO_MARKER("Widgets/Text Input/Miscellaneous");
if (ImGui::TreeNode("Miscellaneous"))
{