## dzl-theme-manager

dzl-theme-manager

## Functions

DzlThemeManager * | dzl_theme_manager_new ()
void | dzl_theme_manager_add_resources ()
void | dzl_theme_manager_remove_resources ()

## Types and Values

#define | DZL_TYPE_THEME_MANAGER
| DzlThemeManager

## Object Hierarchy

        GObject
        ╰── DzlThemeManager

## Description

## Functions

### dzl_theme_manager_new ()

    DzlThemeManager *
    dzl_theme_manager_new (void);

### dzl_theme_manager_add_resources ()

    void
    dzl_theme_manager_add_resources (DzlThemeManager *self,
                                     const gchar *resource_path);

This will automatically register resources found within `resource_path` .

If `resource_path` starts with "resource://", embedded GResources 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.

#### Parameters

self | a DzlThemeManager |
resource_path | A path to a GResources directory |

### dzl_theme_manager_remove_resources ()

    void
    dzl_theme_manager_remove_resources (DzlThemeManager *self,
                                        const gchar *resource_path);

This removes the CSS providers that were registered using `resource_path` .

You must have previously called `dzl_theme_manager_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.

#### Parameters

self | a DzlThemeManager |
resource_path | A previously registered resources path |

## Types and Values

### DZL_TYPE_THEME_MANAGER

    #define DZL_TYPE_THEME_MANAGER (dzl_theme_manager_get_type())

### DzlThemeManager

    typedef struct _DzlThemeManager DzlThemeManager;