| 1691 | } |
| 1692 | |
| 1693 | bool IGFD::FilterManager::DrawFilterComboBox(FileDialogInternal& vFileDialogInternal) { |
| 1694 | if (!dLGFilters.empty()) { |
| 1695 | ImGui::SameLine(); |
| 1696 | bool needToApllyNewFilter = false; |
| 1697 | ImGui::PushItemWidth(GetFilterComboBoxWidth()); |
| 1698 | if (IMGUI_BEGIN_COMBO("##Filters", m_SelectedFilter.title.c_str(), ImGuiComboFlags_None)) { |
| 1699 | intptr_t i = 0; |
| 1700 | for (const auto& filter : m_ParsedFilters) { |
| 1701 | const bool item_selected = (filter.title == m_SelectedFilter.title); |
| 1702 | ImGui::PushID((void*)(intptr_t)i++); |
| 1703 | if (ImGui::Selectable(filter.title.c_str(), item_selected)) { |
| 1704 | m_SelectedFilter = filter; |
| 1705 | needToApllyNewFilter = true; |
| 1706 | } |
| 1707 | ImGui::PopID(); |
| 1708 | } |
| 1709 | ImGui::EndCombo(); |
| 1710 | } |
| 1711 | ImGui::PopItemWidth(); |
| 1712 | if (needToApllyNewFilter) { |
| 1713 | vFileDialogInternal.fileManager.OpenCurrentPath(vFileDialogInternal); |
| 1714 | } |
| 1715 | return needToApllyNewFilter; |
| 1716 | } |
| 1717 | return false; |
| 1718 | } |
| 1719 | |
| 1720 | std::string IGFD::FilterManager::ReplaceExtentionWithCurrentFilterIfNeeded(const std::string& vFileName, IGFD_ResultMode vFlag) const { |
| 1721 | auto result = vFileName; |
no test coverage detected