mirror of
https://github.com/swaywm/sway.git
synced 2026-04-25 06:46:24 -04:00
Cleanup icon theme code
Signed-off-by: Felix Weilbach <felix.weilbach@t-online.de>
This commit is contained in:
parent
93b60f799b
commit
59d245cf5b
4 changed files with 5 additions and 10 deletions
|
|
@ -27,7 +27,7 @@ struct icon_theme {
|
|||
char *dir;
|
||||
list_t *subdirs; // struct icon_theme_subdir *
|
||||
};
|
||||
list_t *get_basedirs(void);
|
||||
|
||||
void init_themes(list_t **themes, list_t **basedirs);
|
||||
void finish_themes(list_t *themes, list_t *basedirs);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ char* append_path_safe(const char * base_path, const char * append_path) {
|
|||
return path;
|
||||
}
|
||||
|
||||
list_t *get_basedirs(void) {
|
||||
static list_t *get_basedirs(void) {
|
||||
list_t *basedirs = create_list();
|
||||
list_add(basedirs, strdup("$HOME/.icons")); // deprecated
|
||||
|
||||
|
|
|
|||
|
|
@ -335,11 +335,11 @@ static bool ipc_parse_config(
|
|||
wl_list_insert(&config->tray_bindings, &binding->link);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
json_object *icon_theme;
|
||||
if ((json_object_object_get_ex(bar_config, "icon_theme", &icon_theme))) {
|
||||
config->icon_theme = strdup(json_object_get_string(icon_theme));
|
||||
}
|
||||
#endif
|
||||
|
||||
json_object_put(bar_config);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -758,18 +758,13 @@ uint32_t render_focused_window_icon(cairo_t *cairo,
|
|||
cairo_surface_t *icon = NULL;
|
||||
if (icon_name) {
|
||||
char *icon_theme = output->bar->config->icon_theme;
|
||||
list_t *basedirs = get_basedirs();
|
||||
int min_size = 0;
|
||||
int max_size = 0;
|
||||
|
||||
list_t *themes = create_list();
|
||||
// TODO: Load correct theme
|
||||
list_add(themes, "Adwaita");
|
||||
|
||||
assert(output->bar);
|
||||
assert(output->bar->themes);
|
||||
char *icon_path = find_icon(output->bar->themes,
|
||||
basedirs,
|
||||
output->bar->basedirs,
|
||||
icon_name,
|
||||
target_size,
|
||||
icon_theme,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue