hbro 0.7.0.0 → 0.7.0.1
raw patch · 4 files changed
+18/−20 lines, 4 files
Files
- Hbro/Core.hs +1/−1
- Hbro/Gui.hs +8/−9
- examples/hbro.hs +8/−9
- hbro.cabal +1/−1
Hbro/Core.hs view
@@ -137,7 +137,7 @@ setup environment -- Manage keys- _ <- after window keyPressEvent $ do+ _ <- after webView keyPressEvent $ do value <- eventKeyVal modifiers <- eventModifier
Hbro/Gui.hs view
@@ -186,15 +186,15 @@ -- | Open prompt bar with given description and default value, -- and register a callback to trigger at validation.-prompt :: String -> String -> (String -> IO ()) -> PromptBar -> IO ()+prompt :: String -> String -> (String -> IO ()) -> GUI -> IO () prompt l d = prompt' l d False -- | Same as 'prompt', but callback is triggered for each change in prompt's entry.-promptIncremental :: String -> String -> (String -> IO ()) -> PromptBar -> IO ()+promptIncremental :: String -> String -> (String -> IO ()) -> GUI -> IO () promptIncremental l d = prompt' l d True -prompt' :: String -> String -> Bool -> (String -> IO ()) -> PromptBar -> IO ()-prompt' description defaultText incremental callback promptBar = do+prompt' :: String -> String -> Bool -> (String -> IO ()) -> GUI -> IO ()+prompt' description defaultText incremental callback _gui@GUI {mPromptBar = promptBar, mWebView = webView} = do openPrompt promptBar description defaultText -- Register callback@@ -209,12 +209,12 @@ widgetHide promptBox signalDisconnect id1 signalDisconnect id2- --widgetGrabFocus webView+ widgetGrabFocus webView "Escape" -> liftIO $ do widgetHide promptBox signalDisconnect id1 signalDisconnect id2- --widgetGrabFocus webView+ widgetGrabFocus webView _ -> return () return False return ()@@ -228,11 +228,11 @@ widgetHide promptBox entryGetText entry >>= callback signalDisconnect id- --widgetGrabFocus webView+ widgetGrabFocus webView "Escape" -> liftIO $ do widgetHide promptBox signalDisconnect id- --widgetGrabFocus webView+ widgetGrabFocus webView _ -> return () return False @@ -240,7 +240,6 @@ where promptBox = mBox promptBar entry = mEntry promptBar- --webView = (mWebView . mGUI) environment -- }}}
examples/hbro.hs view
@@ -7,7 +7,6 @@ import Hbro.Extra.Clipboard import qualified Hbro.Extra.History as History import Hbro.Extra.Misc-import Hbro.Extra.Prompt import Hbro.Extra.Session import Hbro.Extra.StatusBar import Hbro.Gui@@ -96,7 +95,7 @@ (([Control], "<Home>"), goTop scrolledWindow), (([Control], "<End>"), goBottom scrolledWindow), (([Alt], "<Home>"), goHome webView config),- (([Control], "g"), prompt "Google search" "" (\words -> loadURI webView ("https://www.google.com/search?q=" ++ words)) promptBar),+ (([Control], "g"), prompt "Google search" "" (\words -> loadURI webView ("https://www.google.com/search?q=" ++ words)) gui), -- Display (([Control, Shift], "+"), webViewZoomIn webView),@@ -107,13 +106,13 @@ (([Control], "u"), toggleSourceMode webView), -- Prompt- (([Control], "o"), prompt "Open URL " "" (loadURI webView) promptBar),- (([Control, Shift], "O"), webViewGetUri webView >>= maybe (return ()) (\uri -> prompt "Open URL " uri (loadURI webView) promptBar)),+ (([Control], "o"), prompt "Open URL " "" (loadURI webView) gui),+ (([Control, Shift], "O"), webViewGetUri webView >>= maybe (return ()) (\uri -> prompt "Open URL " uri (loadURI webView) gui)), -- Search- (([Shift], "/"), promptIncremental "Search " "" (\word -> webViewSearchText webView word False True True >> return ()) promptBar),- (([Control], "f"), promptIncremental "Search " "" (\word -> webViewSearchText webView word False True True >> return ()) promptBar),- (([Shift], "?"), promptIncremental "Search " "" (\word -> webViewSearchText webView word False False True >> return ()) promptBar),+ (([Shift], "/"), promptIncremental "Search " "" (\word -> webViewSearchText webView word False True True >> return ()) gui),+ (([Control], "f"), promptIncremental "Search " "" (\word -> webViewSearchText webView word False True True >> return ()) gui),+ (([Shift], "?"), promptIncremental "Search " "" (\word -> webViewSearchText webView word False False True >> return ()) gui), (([Control], "n"), entryGetText promptEntry >>= \word -> webViewSearchText webView word False True True >> return ()), (([Control, Shift], "N"), entryGetText promptEntry >>= \word -> webViewSearchText webView word False False True >> return ()), @@ -130,8 +129,8 @@ (([Control], "w"), mainQuit), -- Bookmarks- (([Control], "d"), webViewGetUri webView >>= maybe (return ()) (\uri -> prompt "Bookmark with tags:" "" (\tags -> Bookmarks.add bookmarksFile uri (words tags)) promptBar)),- (([Control, Shift], "D"), prompt "Bookmark all instances with tag:" "" (\tags -> sendCommandToAll context socketDir "GET_URI" >>= mapM (\uri -> Bookmarks.add bookmarksFile uri $ words tags) >> (webViewGetUri webView) >>= maybe (return ()) (\uri -> Bookmarks.add bookmarksFile uri $ words tags) >> return ()) promptBar),+ (([Control], "d"), webViewGetUri webView >>= maybe (return ()) (\uri -> prompt "Bookmark with tags:" "" (\tags -> Bookmarks.add bookmarksFile uri (words tags)) gui)),+ (([Control, Shift], "D"), prompt "Bookmark all instances with tag:" "" (\tags -> sendCommandToAll context socketDir "GET_URI" >>= mapM (\uri -> Bookmarks.add bookmarksFile uri $ words tags) >> (webViewGetUri webView) >>= maybe (return ()) (\uri -> Bookmarks.add bookmarksFile uri $ words tags) >> return ()) gui), (([Alt], "d"), Bookmarks.deleteWithTag bookmarksFile ["-l", "10"]), (([Control], "l"), Bookmarks.select bookmarksFile ["-l", "10"] >>= maybe (return ()) (loadURI webView)), (([Control, Shift], "L"), Bookmarks.selectTag bookmarksFile ["-l", "10"] >>= maybe (return ()) (\uris -> mapM (\uri -> spawn "hbro" ["-u", uri]) uris >> return ())),
hbro.cabal view
@@ -1,5 +1,5 @@ Name: hbro-Version: 0.7.0.0+Version: 0.7.0.1 Synopsis: A minimal KISS compliant browser -- Description: Homepage: http://projects.haskell.org/hbro/