API Reference¶
Adwaita icon theme for wxPython.
Classes:
|
The Adwaita Icon Theme. |
|
Functions:
|
Returns the version of this package and the icon theme, formatted for printing. |
-
class
AdwaitaIconTheme
(name, comment, directories, inherits=None, scaled_directories=None, hidden=False, example='')[source]¶ Bases:
HicolorIconTheme
The Adwaita 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''
.
Attributes:
Methods:
__eq__
(other)Return
self == other
.__iter__
()Iterate over the attributes of the class.
__repr__
()Return a string representation of the
IconTheme
.__str__
()Return
str(self)
.create
()Create an instance of the Adwaita Icon Theme.
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.-
__class_getitem__
= <bound method GenericAlias of <class 'wx_icons_adwaita.AdwaitaIconTheme'>>¶ Type:
MethodType
-
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:
Optional
[Icon
]- Returns:
The icon if it was found, or
None
.
-
version
()[source]¶ Returns the version of this package and the icon theme, formatted for printing.
- Return type:
-
class
wxAdwaitaIconTheme
[source]¶ Bases:
wxHicolorIconTheme
wx.ArtProvider
subclass providing the Adwaita Icon Theme.Methods:
CreateBitmap
(id, client, size)Returns the requested resource.
icon2bitmap
(icon, size)Converts an
Icon
to awx.Bitmap
.-
CreateBitmap
(id, client, size)[source]¶ Returns the requested resource.
- Parameters:
id (
Any
) – Unique identifier of the bitmap.client (
Any
) – Identifier of the client (i.e. who is asking for the bitmap). This only serves as a hint.size (
Union
[Tuple
[int
],Size
]) – Preferred size of the bitmap. The function may return a bitmap of different dimensions; it will be automatically rescaled to meet client’s request.
- Return type:
-