MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / DrawFilterComboBox

Method DrawFilterComboBox

external/ImGuiFileDialog/ImGuiFileDialog.cpp:1693–1718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1691}
1692
1693bool 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
1720std::string IGFD::FilterManager::ReplaceExtentionWithCurrentFilterIfNeeded(const std::string& vFileName, IGFD_ResultMode vFlag) const {
1721 auto result = vFileName;

Callers 1

m_DrawFooterMethod · 0.80

Calls 3

c_strMethod · 0.80
OpenCurrentPathMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected