Dazzle.ThemeManager¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Dazzle.ThemeManager(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Return type:
- add_resources(resource_path)¶
- Parameters:
resource_path (
str
) – A path to aGio.Resources
directory
This will automatically register resources found within resource_path.
If resource_path starts with “resource://”, embedded
Gio.Resources
will be used to locate the theme files. Otherwise, resource_path is expected to be a path on disk that may or may not exist.If the resource_path contains a directory named “themes”, that directory will be traversed for files matching the theme name and variant. For example, if using the Adwaita theme, “themes/Adwaita.css” will be loaded. If the dark variant is being used, “themes/Adwaita-dark.css” will be loaeded. If no matching theme file is located, “themes/shared.css” will be loaded.
When the current theme changes, the CSS will be reloaded to adapt.
The “icons” sub-directory will be used to locate icon themes.
- remove_resources(resource_path)¶
- Parameters:
resource_path (
str
) – A previously registered resources path
This removes the CSS providers that were registered using resource_path.
You must have previously called
Dazzle.ThemeManager.add_resources
() for this function to do anything.Since icons cannot be unloaded, previously loaded icons will continue to be available even after calling this function.