diff options
-rw-r--r-- | include/swaybar/tray/icon.h | 2 | ||||
-rw-r--r-- | swaybar/tray/icon.c | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/include/swaybar/tray/icon.h b/include/swaybar/tray/icon.h index 7a6c400c..8e1d471e 100644 --- a/include/swaybar/tray/icon.h +++ b/include/swaybar/tray/icon.h | |||
@@ -21,7 +21,7 @@ struct icon_theme_subdir { | |||
21 | struct icon_theme { | 21 | struct icon_theme { |
22 | char *name; | 22 | char *name; |
23 | char *comment; | 23 | char *comment; |
24 | char *inherits; | 24 | list_t *inherits; // char * |
25 | list_t *directories; // char * | 25 | list_t *directories; // char * |
26 | 26 | ||
27 | char *dir; | 27 | char *dir; |
diff --git a/swaybar/tray/icon.c b/swaybar/tray/icon.c index 9c62911d..69df3582 100644 --- a/swaybar/tray/icon.c +++ b/swaybar/tray/icon.c | |||
@@ -69,7 +69,7 @@ static void destroy_theme(struct icon_theme *theme) { | |||
69 | } | 69 | } |
70 | free(theme->name); | 70 | free(theme->name); |
71 | free(theme->comment); | 71 | free(theme->comment); |
72 | free(theme->inherits); | 72 | list_free_items_and_destroy(theme->inherits); |
73 | list_free_items_and_destroy(theme->directories); | 73 | list_free_items_and_destroy(theme->directories); |
74 | free(theme->dir); | 74 | free(theme->dir); |
75 | 75 | ||
@@ -149,7 +149,7 @@ static const char *entry_handler(char *group, char *key, char *value, | |||
149 | } else if (strcmp(key, "Comment") == 0) { | 149 | } else if (strcmp(key, "Comment") == 0) { |
150 | theme->comment = strdup(value); | 150 | theme->comment = strdup(value); |
151 | } else if (strcmp(key, "Inherits") == 0) { | 151 | } else if (strcmp(key, "Inherits") == 0) { |
152 | theme->inherits = strdup(value); | 152 | theme->inherits = split_string(value, ","); |
153 | } else if (strcmp(key, "Directories") == 0) { | 153 | } else if (strcmp(key, "Directories") == 0) { |
154 | theme->directories = split_string(value, ","); | 154 | theme->directories = split_string(value, ","); |
155 | } // Ignored: ScaledDirectories, Hidden, Example | 155 | } // Ignored: ScaledDirectories, Hidden, Example |
@@ -496,8 +496,13 @@ static char *find_icon_with_theme(list_t *basedirs, list_t *themes, char *name, | |||
496 | } | 496 | } |
497 | 497 | ||
498 | if (!icon && theme->inherits) { | 498 | if (!icon && theme->inherits) { |
499 | icon = find_icon_with_theme(basedirs, themes, name, size, | 499 | for (int i = 0; i < theme->inherits->length; ++i) { |
500 | theme->inherits, min_size, max_size); | 500 | icon = find_icon_with_theme(basedirs, themes, name, size, |
501 | theme->inherits->items[i], min_size, max_size); | ||
502 | if (icon) { | ||
503 | break; | ||
504 | } | ||
505 | } | ||
501 | } | 506 | } |
502 | 507 | ||
503 | return icon; | 508 | return icon; |