hook up the "new tab" button
This commit is contained in:
parent
ad69c88486
commit
b7956d70bb
@ -11,4 +11,3 @@ Touchscreen-friendly wrapper around Webkit
|
||||
- try video and audio
|
||||
- does it save passwords? find out! where?
|
||||
- better icon for overview button
|
||||
- add new tab
|
||||
|
@ -144,7 +144,8 @@ progress, trough {
|
||||
})
|
||||
]
|
||||
|
||||
(viewplex:listen :title #(window:set_title (.. $1 " - Just browsing")))
|
||||
(viewplex:listen :title #(window:set_title
|
||||
(.. (or $1 "") " - Just browsing")))
|
||||
(viewplex:listen :estimated-load-progress #(tset progress-bar :fraction $1))
|
||||
|
||||
(container:pack_start navbar.widget false false 0)
|
||||
|
@ -1,4 +1,5 @@
|
||||
(local { : Gtk : Gdk : WebKit2 : cairo } (require :lgi))
|
||||
(local Webview (require :webview))
|
||||
|
||||
(local Listeners (require :listeners))
|
||||
|
||||
@ -56,7 +57,10 @@
|
||||
:label " + "
|
||||
:width 300
|
||||
:height 200
|
||||
; :on_clicked #(bus:publish $1 :new-tab)
|
||||
:on_clicked (fn []
|
||||
(self:add-view
|
||||
(doto (Webview.new)
|
||||
(: :visit "about:blank"))))
|
||||
})
|
||||
false false 5)
|
||||
|
||||
@ -93,14 +97,12 @@
|
||||
:widget widget
|
||||
|
||||
:add-view (fn [self webview]
|
||||
(set foreground-view webview)
|
||||
(webview.widget:show)
|
||||
(each [_ event-name (ipairs relay-events)]
|
||||
(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)
|
||||
(self:focus-view webview)
|
||||
page))
|
||||
|
||||
:remove-view (fn [self view]
|
||||
|
Loading…
Reference in New Issue
Block a user