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
|
- try video and audio
|
||||||
- does it save passwords? find out! where?
|
- does it save passwords? find out! where?
|
||||||
- better icon for overview button
|
- 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))
|
(viewplex:listen :estimated-load-progress #(tset progress-bar :fraction $1))
|
||||||
|
|
||||||
(container:pack_start navbar.widget false false 0)
|
(container:pack_start navbar.widget false false 0)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
(local { : Gtk : Gdk : WebKit2 : cairo } (require :lgi))
|
(local { : Gtk : Gdk : WebKit2 : cairo } (require :lgi))
|
||||||
|
(local Webview (require :webview))
|
||||||
|
|
||||||
(local Listeners (require :listeners))
|
(local Listeners (require :listeners))
|
||||||
|
|
||||||
@ -56,7 +57,10 @@
|
|||||||
:label " + "
|
:label " + "
|
||||||
:width 300
|
:width 300
|
||||||
:height 200
|
:height 200
|
||||||
; :on_clicked #(bus:publish $1 :new-tab)
|
:on_clicked (fn []
|
||||||
|
(self:add-view
|
||||||
|
(doto (Webview.new)
|
||||||
|
(: :visit "about:blank"))))
|
||||||
})
|
})
|
||||||
false false 5)
|
false false 5)
|
||||||
|
|
||||||
@ -93,14 +97,12 @@
|
|||||||
:widget widget
|
:widget widget
|
||||||
|
|
||||||
:add-view (fn [self webview]
|
:add-view (fn [self webview]
|
||||||
(set foreground-view webview)
|
|
||||||
(webview.widget:show)
|
(webview.widget:show)
|
||||||
(each [_ event-name (ipairs relay-events)]
|
(each [_ event-name (ipairs relay-events)]
|
||||||
(relay-event webview event-name))
|
(relay-event webview event-name))
|
||||||
(let [page (widget:append_page webview.widget)]
|
(let [page (widget:append_page webview.widget)]
|
||||||
(tset views page webview)
|
(tset views page webview)
|
||||||
(tset self :properties webview.properties)
|
(self:focus-view webview)
|
||||||
(set widget.page page)
|
|
||||||
page))
|
page))
|
||||||
|
|
||||||
:remove-view (fn [self view]
|
:remove-view (fn [self view]
|
||||||
|
Loading…
Reference in New Issue
Block a user