Function lookupThemeIcons
Iterate over all icons in icon themes. iconThemes is usually the range of the main theme and themes it inherits from.
auto auto lookupThemeIcons(alias subdirFilter, IconThemes, BaseDirs, Exts)
(
IconThemes iconThemes,
BaseDirs searchIconDirs,
Exts extensions
)
if (is(ElementType!IconThemes : const(IconThemeFile)) && is(ElementType!BaseDirs : string) && is(ElementType!Exts : string));
Note
Usually if some icon was found in icon theme, it should be ignored in all subsequent themes, including sizes not presented in former theme.
Use subdirFilter to filter icons by IconSubDir
thus decreasing the number of searchable items and allocations.
Returns
Range of IconSearchResult
.
Parameters
Name | Description |
---|---|
iconThemes | Icon themes to search icon in. |
searchIconDirs | Base icon directories. |
extensions | possible file extensions for icon files. |
Example
foreach(item; lookupThemeIcons!(subdir => subdir .context == "MimeTypes" && subdir .size >= 32)(iconThemes, baseIconDirs(), [".png", ".xpm"]))
{
writefln("Icon file: %s. Context: %s. Size: %s", item .filePath, item .subdir .context, item .subdir .size);
}