| 1629 | } |
| 1630 | |
| 1631 | bool IGFD::FilterManager::DrawFilterComboBox(FileDialogInternal& vFileDialogInternal) { |
| 1632 | if (!dLGFilters.empty()) { |
| 1633 | ImGui::SameLine(); |
| 1634 | bool needToApllyNewFilter = false; |
| 1635 | ImGui::PushItemWidth(GetFilterComboBoxWidth()); |
| 1636 | if (IMGUI_BEGIN_COMBO("##Filters", m_SelectedFilter.title.c_str(), ImGuiComboFlags_None)) { |
| 1637 | intptr_t i = 0; |
| 1638 | for (const auto& filter : m_ParsedFilters) { |
| 1639 | const bool item_selected = (filter.title == m_SelectedFilter.title); |
| 1640 | ImGui::PushID((void*)(intptr_t)i++); |
| 1641 | if (ImGui::Selectable(filter.title.c_str(), item_selected)) { |
| 1642 | m_SelectedFilter = filter; |
| 1643 | needToApllyNewFilter = true; |
| 1644 | } |
| 1645 | ImGui::PopID(); |
| 1646 | } |
| 1647 | ImGui::EndCombo(); |
| 1648 | } |
| 1649 | ImGui::PopItemWidth(); |
| 1650 | if (needToApllyNewFilter) { |
| 1651 | vFileDialogInternal.fileManager.OpenCurrentPath(vFileDialogInternal); |
| 1652 | } |
| 1653 | return needToApllyNewFilter; |
| 1654 | } |
| 1655 | return false; |
| 1656 | } |
| 1657 | |
| 1658 | std::string IGFD::FilterManager::ReplaceExtentionWithCurrentFilterIfNeeded(const std::string& vFileName, IGFD_ResultMode vFlag) const { |
| 1659 | auto result = vFileName; |
no test coverage detected