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.
IconSearchResult. filePath will be empty if icon is 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)]; auto found = findLargestThemedIcon("folder", iconThemes, baseDirs); assert(found.filePath == buildPath("test", "Tango", "128x128/places", "folder.png")); assert(found.subdir.size == 128); assert(found.subdir.context == "Places"); assert(found.iconTheme.internalName == "Tango"); found = findLargestThemedIcon!(subdir => subdir.context == "Places")("folder", iconThemes, baseDirs); assert(found.filePath == buildPath("test", "Tango", "128x128/places", "folder.png")); found = findLargestThemedIcon!(subdir => subdir.context == "Actions")("folder", iconThemes, baseDirs); assert(found.filePath.empty); found = findLargestThemedIcon("desktop", iconThemes, baseDirs); assert(found.filePath == buildPath("test", "Tango", "32x32/places", "desktop.png")); assert(found.subdir.size == 32); found = findLargestThemedIcon("desktop", iconThemes, baseDirs, [".svg", ".png"]); assert(found.filePath == buildPath("test", "Tango", "scalable/places", "desktop.svg")); assert(found.subdir.type == IconSubDir.Type.Scalable);
findLargestIcon, icontheme.paths.baseIconDirs, lookupIcon, findNonThemedIcon
Find icon of the largest size. It uses icon theme cache wherever possible.