fetch urls typed into urlbar

phoen
Daniel Barlow 2022-02-05 13:01:48 +00:00
parent 71289309b8
commit 9ef0818465
2 changed files with 5 additions and 3 deletions

View File

@ -11,5 +11,4 @@ Touchscreen-friendly wrapper around Webkit
- support multiple tabs
- find out if it's going to eat cpu like luakit does
- some kind of bookmarks/favourites/pinned tabs
- fetch url when typed in
- ESC in url bar cancels typing

View File

@ -17,7 +17,8 @@
nav-bar (Gtk.Box {
:orientation Gtk.Orientation.HORIZONTAL
})
url (doto (Gtk.Entry) (: :set_text current-url))
url (doto (Gtk.Entry)
(: :set_text current-url))
webview (WebKit2.WebView {
:on_notify
(fn [self pspec c]
@ -31,7 +32,6 @@
})
back (doto
(Gtk.Button {
;; :label "<-"
:on_clicked (fn [s]
(if (webview:can_go_back)
(webview:go_back)))
@ -39,6 +39,9 @@
(: :set_image
(Gtk.Image.new_from_icon_name "go-previous" Gtk.IconSize.LARGE_TOOLBAR)))]
(tset url :on_activate (fn [self]
(webview:load_uri self.text)))
(nav-bar:pack_start back false false 2)
(nav-bar:pack_start url true true 2)