eufon

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 1fcd4fc9335aa49f93c93ad99fc9dd4ee3d8d2cb
parent 7f1eddafceb98fe4809fb0fd322596211d213aa4
Author: Daniel Barlow <dan@telent.net>
Date:   Thu, 24 Mar 2022 22:46:58 +0000

fix load-icon for abolute paths

Diffstat:
Mblinkenlicht/blinkenlicht.fnl | 15+++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/blinkenlicht/blinkenlicht.fnl b/blinkenlicht/blinkenlicht.fnl @@ -32,16 +32,19 @@ (local found-icons {}) (fn load-icon [name] - (if (= (name:sub 1 1) "/") - ;; From a direct path - (GdkPixbuf.Pixbuf.new_from_file_at_scale name HEIGHT -1 true) - ;; From icon theme - (Gtk.Image.new_from_pixbuf (find-icon-pixbuf name)))) + (let [pixbuf + (if (= (name:sub 1 1) "/") + ;; From a direct path + (GdkPixbuf.Pixbuf.new_from_file_at_scale name HEIGHT -1 true) + ;; From icon theme + (find-icon-pixbuf name))] + (Gtk.Image.new_from_pixbuf pixbuf))) (fn find-icon [name] (let [icon (. found-icons name)] (or icon - (let [icon (load-icon name)] + (let [(icon err) (load-icon name)] + (if (not icon) (print err)) (tset found-icons name icon) icon))))