diff --git a/just/README.md b/just/README.md index 87c766d..3a1fc32 100644 --- a/just/README.md +++ b/just/README.md @@ -7,7 +7,6 @@ Touchscreen-friendly wrapper around Webkit - downloads (pass to download manager) - find out if it's going to eat cpu like luakit does - some kind of bookmarks/favourites/pinned tabs/memory of visited sites -- ESC in url bar cancels typing - warning for insecure sites - try video and audio - does it save passwords? find out! where? diff --git a/just/just.fnl b/just/just.fnl index b3678c6..95ddff3 100644 --- a/just/just.fnl +++ b/just/just.fnl @@ -64,6 +64,10 @@ progress, trough { (text:find "^http") text (.. "https://" text))) +(local keysyms { + :Escape 0xff1b + }) + (local Navbar { @@ -73,6 +77,9 @@ progress, trough { ;; :completion (Gtk.EntryCompletion {:model completions :text_column 0 }) :on_activate #(webview:visit (to-uri $1.text)) + :on_key_release_event + #(if (= $2.keyval keysyms.Escape) + (tset $1 :text webview.properties.uri)) }) stop (doto (Gtk.Button { :on_clicked #(webview:stop-loading) diff --git a/just/viewplex.fnl b/just/viewplex.fnl index 0ad19b3..364ce12 100644 --- a/just/viewplex.fnl +++ b/just/viewplex.fnl @@ -99,6 +99,7 @@ (relay-event webview event-name)) (let [page (widget:append_page webview.widget)] (tset views page webview) + (tset self :properties webview.properties) (set widget.page page) page)) @@ -109,11 +110,12 @@ (self:show-overview) )) - :focus-view (fn [_ view] + :focus-view (fn [self view] (when view (set foreground-view view) (each [_ prop (ipairs relay-events)] (listeners:notify prop (. view.properties prop))) + (tset self :properties view.properties) (set widget.page (widget:page_num view.widget)))) :show-overview (fn [self]