extract function for webview properties handler
This commit is contained in:
parent
184aefa4dc
commit
1cd2247e02
@ -72,6 +72,28 @@ progress, trough {
|
||||
))
|
||||
|
||||
|
||||
(fn handle-webview-properties [self pspec bus]
|
||||
(if (= pspec.name "uri")
|
||||
(bus:publish
|
||||
:url-changed self.uri)
|
||||
|
||||
(and (= pspec.name "title")
|
||||
(> (# self.title) 0))
|
||||
(bus:publish
|
||||
:title-changed
|
||||
self.title)
|
||||
|
||||
(= pspec.name
|
||||
"estimated-load-progress")
|
||||
(bus:publish
|
||||
:loading-progress
|
||||
self.estimated_load_progress)
|
||||
|
||||
(= pspec.name "is-loading")
|
||||
(bus:publish
|
||||
:loading? self.is_loading)
|
||||
))
|
||||
|
||||
(let [current-url "https://terse.telent.net/admin/stream"
|
||||
bus (event-bus)
|
||||
r {}
|
||||
@ -108,27 +130,7 @@ progress, trough {
|
||||
})
|
||||
webview (WebKit2.WebView {
|
||||
:on_notify
|
||||
(fn [self pspec c]
|
||||
(if (= pspec.name "uri")
|
||||
(bus:publish
|
||||
:url-changed self.uri)
|
||||
|
||||
(and (= pspec.name "title")
|
||||
(> (# self.title) 0))
|
||||
(bus:publish
|
||||
:title-changed
|
||||
self.title)
|
||||
|
||||
(= pspec.name
|
||||
"estimated-load-progress")
|
||||
(bus:publish
|
||||
:loading-progress
|
||||
self.estimated_load_progress)
|
||||
|
||||
(= pspec.name "is-loading")
|
||||
(bus:publish
|
||||
:loading? self.is_loading)
|
||||
))
|
||||
#(handle-webview-properties $1 $2 bus)
|
||||
})
|
||||
back (doto
|
||||
(Gtk.Button {
|
||||
|
Loading…
Reference in New Issue
Block a user