diff options
author | Ben Brown <benjamb@pm.me> | 2019-09-02 15:57:51 +0100 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2019-09-04 03:32:45 -0400 |
commit | 0ad5e355bd8c5035f9219aa068418c38a6bbd4b8 (patch) | |
tree | 564e4b07c29470c9d91006af06ec759c3c33dc79 | |
parent | Fix bar_state_update docs (diff) | |
download | sway-0ad5e355bd8c5035f9219aa068418c38a6bbd4b8.tar.gz sway-0ad5e355bd8c5035f9219aa068418c38a6bbd4b8.tar.zst sway-0ad5e355bd8c5035f9219aa068418c38a6bbd4b8.zip |
Add icon_theme_path to find_icon() search if set
find_icon() will search in theme appropriate subdirs.
-rw-r--r-- | swaybar/tray/item.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/swaybar/tray/item.c b/swaybar/tray/item.c index 027b3001..c8fcd382 100644 --- a/swaybar/tray/item.c +++ b/swaybar/tray/item.c | |||
@@ -411,9 +411,15 @@ uint32_t render_sni(cairo_t *cairo, struct swaybar_output *output, double *x, | |||
411 | char *icon_name = sni->status[0] == 'N' ? | 411 | char *icon_name = sni->status[0] == 'N' ? |
412 | sni->attention_icon_name : sni->icon_name; | 412 | sni->attention_icon_name : sni->icon_name; |
413 | if (icon_name) { | 413 | if (icon_name) { |
414 | char *icon_path = find_icon(sni->tray->themes, sni->tray->basedirs, | 414 | list_t *icon_search_paths = create_list(); |
415 | list_cat(icon_search_paths, sni->tray->basedirs); | ||
416 | if (sni->icon_theme_path) { | ||
417 | list_add(icon_search_paths, sni->icon_theme_path); | ||
418 | } | ||
419 | char *icon_path = find_icon(sni->tray->themes, icon_search_paths, | ||
415 | icon_name, ideal_size, output->bar->config->icon_theme, | 420 | icon_name, ideal_size, output->bar->config->icon_theme, |
416 | &sni->min_size, &sni->max_size); | 421 | &sni->min_size, &sni->max_size); |
422 | list_free(icon_search_paths); | ||
417 | if (!icon_path && sni->icon_theme_path) { | 423 | if (!icon_path && sni->icon_theme_path) { |
418 | icon_path = find_icon_in_dir(icon_name, sni->icon_theme_path, | 424 | icon_path = find_icon_in_dir(icon_name, sni->icon_theme_path, |
419 | &sni->min_size, &sni->max_size); | 425 | &sni->min_size, &sni->max_size); |