From a5ea2027d551f25e3e852f8ac2772108f76dd4e0 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sat, 5 Feb 2022 21:47:12 +0000 Subject: [PATCH] extract named-image function --- just/just.fnl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/just/just.fnl b/just/just.fnl index 0f2b62a..922eac7 100644 --- a/just/just.fnl +++ b/just/just.fnl @@ -9,6 +9,11 @@ (local content-filter-store (WebKit2.UserContentFilterStore {:path cache-dir})) +(fn named-image [name size] + (Gtk.Image.new_from_icon_name + name + (or size Gtk.IconSize.LARGE_TOOLBAR))) + (fn load-easylist-json [store cb] (print "loading easylist from json") (with-open [f (io.open "easylist_min_content_blocker.json" "r")] @@ -68,9 +73,7 @@ (if (webview:can_go_back) (webview:go_back))) }) - (: :set_image - (Gtk.Image.new_from_icon_name "go-previous" Gtk.IconSize.LARGE_TOOLBAR)))] - + (: :set_image (named-image "go-previous")))] (load-adblocks webview.user_content_manager content-filter-store) (tset url :on_activate (fn [self]