wx_icons_hicolor.directory

Class to represent directory of icons.

Classes:

Directory(path, size[, scale, context, …])

Represents a directory containing icons.

class Directory(path, size, scale=1, context='', type='Threshold', max_size=None, min_size=None, threshold=2, theme='')[source]

Bases: Dictable

Represents a directory containing icons.

Parameters
  • path (Union[str, Path, PathLike]) – The absolute path to the directory

  • size (int) – Nominal (unscaled) size of the icons in this directory.

  • scale (int) – Target scale of the icons in this directory. Any directory with a scale other than 1 should be listed in the ScaledDirectories list rather than Directories for backwards compatibility. Default 1.

  • context (str) – The context the icon is normally used in. This is in detail discussed in the section called “Context”. Default ''.

  • type (Literal['Fixed', 'Scalable', 'Threshold']) – The type of icon sizes for the icons in this directory. Valid types are 'Fixed', 'Scalable' and 'Threshold'. The type decides what other keys in the section are used. Default 'Threshold'.

  • max_size (Optional[int]) – Specifies the maximum (unscaled) size that the icons in this directory can be scaled to. Defaults to the value of Size if not present.

  • min_size (Optional[int]) – Specifies the minimum (unscaled) size that the icons in this directory can be scaled to. Defaults to the value of Size if not present.

  • threshold (int) – The icons in this directory can be used if the size differ at most this much from the desired (unscaled) size. Defaults to 2 if not present. Default 2.

  • theme (str) – The name of the theme this directory is a part of. Default ''.

Methods:

__repr__()

Return a string representation of the Directory.

from_configparser(config_section, …)

Constructs a Directory from a configparser section.

Attributes:

icons

Returns a list of icons in this Directory.

__repr__()[source]

Return a string representation of the Directory.

Return type

str

classmethod from_configparser(config_section, theme_content_root)[source]

Constructs a Directory from a configparser section.

Parameters
  • config_section (SectionProxy)

  • theme_content_root (Path)

Return type

Directory

property icons

Returns a list of icons in this Directory.

Return type

List[Icon]