MCPcopy Create free account
hub / github.com/aiekick/ImGuiFileDialog / DrawPathComposer

Method DrawPathComposer

ImGuiFileDialog.cpp:2603–2700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2601}
2602
2603void IGFD::FileManager::DrawPathComposer(const FileDialogInternal& vFileDialogInternal) {
2604 if (IMGUI_BUTTON(resetButtonString)) {
2605 SetCurrentPath(".");
2606 OpenCurrentPath(vFileDialogInternal);
2607 }
2608 if (ImGui::IsItemHovered()) {
2609 ImGui::SetTooltip(buttonResetPathString);
2610 }
2611 if (vFileDialogInternal.getDialogConfig().flags & ImGuiFileDialogFlags_ShowDevicesButton) {
2612 ImGui::SameLine();
2613 if (IMGUI_BUTTON(devicesButtonString)) {
2614 devicesClicked = true;
2615 }
2616 if (ImGui::IsItemHovered()) {
2617 ImGui::SetTooltip(buttonDriveString);
2618 }
2619 }
2620
2621 ImGui::SameLine();
2622
2623 if (IMGUI_BUTTON(editPathButtonString)) {
2624 inputPathActivated = !inputPathActivated;
2625 if (inputPathActivated) {
2626 if (!m_CurrentPathDecomposition.empty()) {
2627 auto endIt = m_CurrentPathDecomposition.end();
2628 m_CurrentPath = ComposeNewPath(--endIt);
2629 IGFD::Utils::SetBuffer(inputPathBuffer, MAX_PATH_BUFFER_SIZE, m_CurrentPath);
2630 }
2631 }
2632 }
2633 if (ImGui::IsItemHovered()) {
2634 ImGui::SetTooltip(buttonEditPathString);
2635 }
2636
2637 ImGui::SameLine();
2638
2639 ImGui::SeparatorEx(ImGuiSeparatorFlags_Vertical);
2640
2641 // show current path
2642 if (!m_CurrentPathDecomposition.empty()) {
2643 ImGui::SameLine();
2644
2645 if (inputPathActivated) {
2646 ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
2647 ImGui::InputText("##pathedition", inputPathBuffer, MAX_PATH_BUFFER_SIZE);
2648 ImGui::PopItemWidth();
2649 } else {
2650 int _id = 0;
2651 for (auto itPathDecomp = m_CurrentPathDecomposition.begin(); itPathDecomp != m_CurrentPathDecomposition.end(); ++itPathDecomp) {
2652 if (itPathDecomp != m_CurrentPathDecomposition.begin()) {
2653#if defined(CUSTOM_PATH_SPACING)
2654 ImGui::SameLine(0, CUSTOM_PATH_SPACING);
2655#else
2656 ImGui::SameLine();
2657#endif // USE_CUSTOM_PATH_SPACING
2658 if (!(vFileDialogInternal.getDialogConfig().flags & ImGuiFileDialogFlags_DisableQuickPathSelection)) {
2659#if defined(_IGFD_WIN_)
2660 const char* sep = "\\";

Callers 1

Calls 3

emptyMethod · 0.80
endMethod · 0.80
beginMethod · 0.80

Tested by

no test coverage detected