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!(subdir => subdir.context == "Places")("folder", iconThemes, baseDirs); assert(found == buildPath("test", "Tango", "128x128/places", "folder.png")); found = findLargestIcon!(subdir => subdir.context == "Actions")("folder", iconThemes, baseDirs); assert(found.empty); 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 non-themed found = findLargestIcon("pidgin", iconThemes, baseDirs); assert(found == buildPath("test", "pidgin.png")); //don't lookup non-themed found = findLargestIcon("pidgin", iconThemes, baseDirs, defaultIconExtensions, No.allowNonThemed); assert(found.empty);
findLargestThemedIcon, icontheme.paths.baseIconDirs, lookupIcon, findNonThemedIcon
Find icon of the largest size. It uses icon theme cache wherever possible. This is similar to findLargestThemedIcon, but returns file path only and allows to search for non-themed icons.