| 2663 | } |
| 2664 | |
| 2665 | void IGFD::FileManager::DrawPathComposer(const FileDialogInternal& vFileDialogInternal) { |
| 2666 | if (IMGUI_BUTTON(resetButtonString)) { |
| 2667 | SetCurrentPath("."); |
| 2668 | OpenCurrentPath(vFileDialogInternal); |
| 2669 | } |
| 2670 | if (ImGui::IsItemHovered()) { |
| 2671 | ImGui::SetTooltip(buttonResetPathString); |
| 2672 | } |
| 2673 | if (vFileDialogInternal.getDialogConfig().flags & ImGuiFileDialogFlags_ShowDevicesButton) { |
| 2674 | ImGui::SameLine(); |
| 2675 | if (IMGUI_BUTTON(devicesButtonString)) { |
| 2676 | devicesClicked = true; |
| 2677 | } |
| 2678 | if (ImGui::IsItemHovered()) { |
| 2679 | ImGui::SetTooltip(buttonDriveString); |
| 2680 | } |
| 2681 | } |
| 2682 | |
| 2683 | ImGui::SameLine(); |
| 2684 | |
| 2685 | if (IMGUI_BUTTON(editPathButtonString)) { |
| 2686 | inputPathActivated = !inputPathActivated; |
| 2687 | if (inputPathActivated) { |
| 2688 | if (!m_CurrentPathDecomposition.empty()) { |
| 2689 | auto endIt = m_CurrentPathDecomposition.end(); |
| 2690 | m_CurrentPath = ComposeNewPath(--endIt); |
| 2691 | IGFD::Utils::SetBuffer(inputPathBuffer, MAX_PATH_BUFFER_SIZE, m_CurrentPath); |
| 2692 | } |
| 2693 | } |
| 2694 | } |
| 2695 | if (ImGui::IsItemHovered()) { |
| 2696 | ImGui::SetTooltip(buttonEditPathString); |
| 2697 | } |
| 2698 | |
| 2699 | ImGui::SameLine(); |
| 2700 | |
| 2701 | ImGui::SeparatorEx(ImGuiSeparatorFlags_Vertical); |
| 2702 | |
| 2703 | // show current path |
| 2704 | if (!m_CurrentPathDecomposition.empty()) { |
| 2705 | ImGui::SameLine(); |
| 2706 | |
| 2707 | if (inputPathActivated) { |
| 2708 | ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x); |
| 2709 | ImGui::InputText("##pathedition", inputPathBuffer, MAX_PATH_BUFFER_SIZE); |
| 2710 | ImGui::PopItemWidth(); |
| 2711 | } else { |
| 2712 | int _id = 0; |
| 2713 | for (auto itPathDecomp = m_CurrentPathDecomposition.begin(); itPathDecomp != m_CurrentPathDecomposition.end(); ++itPathDecomp) { |
| 2714 | if (itPathDecomp != m_CurrentPathDecomposition.begin()) { |
| 2715 | #if defined(CUSTOM_PATH_SPACING) |
| 2716 | ImGui::SameLine(0, CUSTOM_PATH_SPACING); |
| 2717 | #else |
| 2718 | ImGui::SameLine(); |
| 2719 | #endif // USE_CUSTOM_PATH_SPACING |
| 2720 | if (!(vFileDialogInternal.getDialogConfig().flags & ImGuiFileDialogFlags_DisableQuickPathSelection)) { |
| 2721 | #if defined(_IGFD_WIN_) |
| 2722 | const char* sep = "\\"; |
no test coverage detected