wx_icons_hicolor.icon_theme
¶
Class to represent an icon theme.
Classes:
|
The Hicolor Icon Theme. |
|
Represents an icon theme. |
-
class
HicolorIconTheme
(name, comment, directories, inherits=None, scaled_directories=None, hidden=False, example='')[source]¶ Bases:
IconTheme
The Hicolor Icon Theme.
- Parameters
name (
str
) – short name of the icon theme, used in e.g. lists when selecting themes.comment (
str
) – longer string describing the themeinherits (
Optional
[Sequence
[str
]]) –The name of the theme that this theme inherits from. If an icon name is not found in the current theme, it is searched for in the inherited theme (and recursively in all the inherited themes). Default
None
.If no theme is specified implementations are required to add the “hicolor” theme to the inheritance tree. An implementation may optionally add other default themes in between the last specified theme and the hicolor theme.
directories (
Sequence
[Directory
]) – list of subdirectories for this theme. For every subdirectory there must be a section in the index.theme file describing that directory.scaled_directories (
Optional
[Sequence
[Directory
]]) – Additional list of subdirectories for this theme, in addition to the ones in Directories. These directories should only be read by implementations supporting scaled directories and was added to keep compatibility with old implementations that don’t support these. DefaultNone
.hidden (
bool
) – Whether to hide the theme in a theme selection user interface. This is used for things such as fallback-themes that are not supposed to be visible to the user. DefaultFalse
.example (
str
) – The name of an icon that should be used as an example of how this theme looks. Default''
.
Methods:
create
()Create an instance of the Hicolor Icon Theme.
-
class
IconTheme
(name, comment, directories, inherits=None, scaled_directories=None, hidden=False, example='')[source]¶ Bases:
Dictable
Represents an icon theme.
- Parameters
name (
str
) – short name of the icon theme, used in e.g. lists when selecting themes.comment (
str
) – longer string describing the themeinherits (
Optional
[Sequence
[str
]]) –The name of the theme that this theme inherits from. If an icon name is not found in the current theme, it is searched for in the inherited theme (and recursively in all the inherited themes). Default
None
.If no theme is specified implementations are required to add the “hicolor” theme to the inheritance tree. An implementation may optionally add other default themes in between the last specified theme and the hicolor theme.
directories (
Sequence
[Directory
]) – list of subdirectories for this theme. For every subdirectory there must be a section in the index.theme file describing that directory.scaled_directories (
Optional
[Sequence
[Directory
]]) – Additional list of subdirectories for this theme, in addition to the ones in Directories. These directories should only be read by implementations supporting scaled directories and was added to keep compatibility with old implementations that don’t support these. DefaultNone
.hidden (
bool
) – Whether to hide the theme in a theme selection user interface. This is used for things such as fallback-themes that are not supposed to be visible to the user. DefaultFalse
.example (
str
) – The name of an icon that should be used as an example of how this theme looks. Default''
.
Methods:
__repr__
()Return a string representation of the
IconTheme
.__str__
()Return
str(self)
.find_icon
(icon_name, size, scale[, …])Searches for the icon with the given name and size.
from_configparser
(theme_index_path)Constructs a
IconTheme
from config file.-
find_icon
(icon_name, size, scale, prefer_this_theme=True)[source]¶ Searches for the icon with the given name and size.
- Parameters
icon_name (
str
) – The name of the icon to find. Any FreeDesktop Icon Theme Specification name can be used.size (
int
) – The desired size of the iconscale (
Any
) – TODO: Currently does nothingprefer_this_theme (
bool
) – Return an icon from this theme even if it has to be resized, rather than a correctly sized icon from the parent theme. DefaultTrue
.
- Return type
- Returns
The icon if it was found, or
None
.