Name of icon to search as defined by Icon Theme Specification (i.e. without path and extension parts).
Range of icontheme.file.IconThemeFile objects.
Base icon directories.
Allowed file extensions.
Allow searching for non-themed fallback if could not find icon in themes.
Icon file path or empty string if not found. Note: If icon of some size was found in the icon theme, this algorithm does not check following themes, even if they contain icons with larger size. Therefore the icon found in the most preferred theme always has presedence over icons from other themes.
auto baseDirs = ["test"]; auto iconThemes = [openIconTheme("Tango", baseDirs), openIconTheme("hicolor", baseDirs)]; string found; found = findLargestIcon("folder", iconThemes, baseDirs); assert(found == buildPath("test", "Tango", "128x128/places", "folder.png")); found = findLargestIcon("desktop", iconThemes, baseDirs); assert(found == buildPath("test", "Tango", "32x32/places", "desktop.png")); found = findLargestIcon("desktop", iconThemes, baseDirs, [".svg", ".png"]); assert(found == buildPath("test", "Tango", "scalable/places", "desktop.svg")); //lookup with fallback found = findLargestIcon("pidgin", iconThemes, baseDirs); assert(found == buildPath("test", "pidgin.png")); //lookup without fallback found = findLargestIcon("pidgin", iconThemes, baseDirs, defaultIconExtensions, No.allowFallbackIcon); assert(found.empty);
icontheme.paths.baseIconDirs, lookupIcon, findFallbackIcon
Find icon of the largest size. It uses icon theme cache wherever possible.