Remove conditionals and old code for locating and loading icons

With libsfdo a hard dependency we can locate and load icons always,
regardless of whether we have tray or not. Old locating and loading code
can also be removed.
This commit is contained in:
myrslint 2025-07-02 21:59:38 +00:00
parent 0872673472
commit 6d7c0d52d6
10 changed files with 7 additions and 134 deletions

View file

@ -20,9 +20,7 @@
#include "stringop.h"
#include "wlr-layer-shell-unstable-v1-client-protocol.h"
#if HAVE_LIBSFDO
#include "sfdo.h"
#endif
// TODO menu
@ -426,16 +424,6 @@ static void reload_sni(struct swaybar_sni *sni, char *icon_theme, int target_siz
sni->attention_icon_name : sni->icon_name;
if (icon_name) {
char *icon_path = NULL;
#if !HAVE_LIBSFDO
list_t *icon_search_paths = create_list();
list_cat(icon_search_paths, sni->tray->basedirs);
if (sni->icon_theme_path) {
list_add(icon_search_paths, sni->icon_theme_path);
}
icon_path = find_icon(sni->tray->themes, icon_search_paths,
icon_name, target_size, icon_theme,
&sni->min_size, &sni->max_size);
#else
// TODO: at some point we will need to make this scaling-aware
int scale = 1;
struct sfdo *sfdo = sni->tray->bar->config->sfdo;
@ -446,10 +434,6 @@ static void reload_sni(struct swaybar_sni *sni, char *icon_theme, int target_siz
icon_name, icon_theme, target_size);
}
}
#endif
#if !HAVE_LIBSFDO
list_free(icon_search_paths);
#endif
if (icon_path) {
cairo_surface_destroy(sni->icon);
sni->icon = load_image(icon_path, target_size, scale);