From d44ed56d44161cd50694b9c03392241323f5e3d6 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sun, 6 Feb 2022 17:52:15 +0000 Subject: [PATCH] put history control on the bus --- just/just.fnl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/just/just.fnl b/just/just.fnl index 192b371..89bc84d 100644 --- a/just/just.fnl +++ b/just/just.fnl @@ -9,8 +9,6 @@ (local content-filter-store (WebKit2.UserContentFilterStore {:path cache-dir})) - - (-> (WebKit2.WebContext:get_default) (: :get_website_data_manager) (: :get_cookie_manager) @@ -105,6 +103,9 @@ progress, trough { (bus:subscribe :fetch #(webview:load_uri $1)) (bus:subscribe :stop-loading #(webview:stop_loading)) (bus:subscribe :reload #(webview:reload)) + (bus:subscribe :go-back #(if (webview:can_go_back) + (webview:go_back))) + (load-adblocks webview.user_content_manager content-filter-store) webview)) @@ -139,12 +140,13 @@ progress, trough { :on_clicked #(bus:publish :reload) }) (: :set_image (named-image "view-refresh"))) + ;; views (Gtk.Notebook { + ;; :show_tabs false + ;; }) webview (new-webview bus) back (doto (Gtk.Button { - :on_clicked (fn [s] - (if (webview:can_go_back) - (webview:go_back))) + :on_clicked #(bus:publish :go-back) }) (: :set_image (named-image "go-previous")))]