manatee 0.0.5 → 0.0.6
raw patch · 10 files changed
+46/−58 lines, 10 filesdep ~manatee-core
Dependency ranges changed: manatee-core
Files
- Manatee/Action/Basic.hs +2/−6
- Manatee/Action/BufferList.hs +4/−5
- Manatee/Action/Tab.hs +2/−4
- Manatee/Action/Tabbar.hs +1/−3
- Manatee/Daemon.hs +20/−27
- Manatee/UI/FocusNotifier.hs +1/−6
- Manatee/UI/UIFrame.hs +8/−0
- Manatee/UI/WindowNode.hs +2/−2
- manatee.cabal +5/−4
- repos.sh +1/−1
Manatee/Action/Basic.hs view
@@ -193,9 +193,7 @@ containerRemoveAll anythingBox -- Add box and interactivebar.- interactivebarSetTitle interactivebar "Search "- interactivebarSetContent interactivebar "" -- clean input- interactivebarShow anythingBox interactivebar+ interactivebarInit interactivebar anythingBox "Search " "" frame `containerAdd` anythingBox widgetShowAll anythingBox @@ -287,9 +285,7 @@ getCurrentUIFrame env >?>= \uiFrame -> do let interactivebar = uiFrameInteractivebar uiFrame -- Show interactivebar.- interactivebarSetTitle interactivebar "Search " - interactivebarSetContent interactivebar "" -- clean input- uiFrameShowInteractivebar uiFrame+ uiFrameInit uiFrame "Search " "" -- When PopupWindow is invisible startup anythingView process. whenM (not <$> popupWindowIsVisible popupWindow) (do
Manatee/Action/BufferList.hs view
@@ -133,11 +133,10 @@ in case matchBuffer of Nothing -> Nothing Just (_, bufferSeq) -> - case Seq.findIndexL (\x -> bufferPageId x == pageId) bufferSeq of- Nothing -> Nothing- Just bi -> - let oldBuffer = Seq.index bufferSeq bi - in Just (oldBuffer, (bi, bufferSeq))+ fmap (\bi -> + let oldBuffer = Seq.index bufferSeq bi + in (oldBuffer, (bi, bufferSeq)) + ) $ Seq.findIndexL (\x -> bufferPageId x == pageId) bufferSeq -- | Get buffer with given mode name and page id. bufferListGetBuffer :: BufferList -> PageModeName -> PageId -> Maybe Buffer
Manatee/Action/Tab.hs view
@@ -228,10 +228,8 @@ tabClose env tPageId = do (client, (window, (tabbarTVar, bufferListTVar))) <- envGet env - let windowId = windowGetId window- (Tabbar tabbar) <- readTVarIO tabbarTVar- tabbarGetTabInfo (Tabbar tabbar) windowId + tabbarGetTabInfo (Tabbar tabbar) (windowGetId window) ?>= \ (modeName, tabSeq) -> -- Find page index that match page id. Seq.findIndexL (\x -> tabPageId x == tPageId) tabSeq@@ -251,7 +249,7 @@ (BufferList bufferList) <- readTVarIO bufferListTVar return $ findNextCycle (== currentModeName) (M.keys bufferList) - -- PUsh close tab to history list.+ -- Push close tab to history list. pushCloseTab env modeName pageId -- Update buffer list.
Manatee/Action/Tabbar.hs view
@@ -77,9 +77,7 @@ tabbarGetTabInfo :: Tabbar -> WindowId -> Maybe (PageModeName, Seq Tab) tabbarGetTabInfo (Tabbar tabbar) windowId = info where matchTab = findMinMatch tabbar (\ (wId, _) _ -> wId == windowId)- info = case matchTab of- Nothing -> Nothing- Just ((_, name), tabs) -> Just (name, tabs)+ info = fmap (\ ((_, name), tabs) -> (name, tabs)) matchTab -- | Get page mode name with window id. tabbarGetPageModeName :: Tabbar -> WindowId -> Maybe PageModeName
Manatee/Daemon.hs view
@@ -20,6 +20,7 @@ module Manatee.Daemon where import Control.Applicative hiding (empty)+import Control.Arrow import Control.Concurrent.MVar import Control.Exception import Control.Monad@@ -365,11 +366,12 @@ -- Adjust tab name. pageModeDuplicateTabList <- getDuplicateTabList- if modeName `elem` pageModeDuplicateTabList- -- Just strip tab name when current page mode in 'pageModeDuplicateTabList'- then modifyTVarIO bufferListTVar (bufferListStripName modeName pageId path)- -- Otherwise unique all tab names.- else modifyTVarIO bufferListTVar (bufferListUniqueName modeName)+ modifyTVarIO bufferListTVar+ (if modeName `elem` pageModeDuplicateTabList+ -- Just strip tab name when current page mode in 'pageModeDuplicateTabList'+ then bufferListStripName modeName pageId path+ -- Otherwise unique all tab names.+ else bufferListUniqueName modeName) -- Update notebook name. forM_ (M.toList tabbar) $ \ ((windowId, pageModeName), _) -> @@ -419,8 +421,7 @@ -- Or update track value and input next. else do let restTrack = tail track- interactiveName = (fst . head) restTrack- interactiveTitle = (snd . head) restTrack+ (interactiveName, interactiveTitle) = head restTrack -- Update track value. writeTVarIO (envLocalInteractiveTrack env) restTrack @@ -429,6 +430,7 @@ let interactivebar = uiFrameInteractivebar uiFrame interactivebarSetTitle interactivebar interactiveTitle interactivebarSetContent interactivebar ""+ -- Hide popup window. popupWindowSetAllocation popupWindow (Rectangle 0 0 1 1) -- Change anything view candidate.@@ -457,9 +459,7 @@ else do -- Get interactive name and title. let restTrack = tail track- interactiveName = (fst . head) restTrack- interactiveTitle = (snd . head) restTrack-+ (interactiveName, interactiveTitle) = head restTrack -- Update track value. writeTVarIO (envGlobalInteractiveTrack env) restTrack @@ -509,10 +509,7 @@ ,tabUIFrame = UIFrame {uiFrameFrame = frame}}) -> do -- Translate UIFrame coordinate to top-level coordinate. (Rectangle fx fy _ _) <- widgetGetAllocation frame- let tooltipPoint = - case point of- Just (px, py) -> Just (fx + px, fy + py)- Nothing -> Nothing+ let tooltipPoint = fmap ((+) fx *** (+) fy) point case pageId of -- Show tooltip directly when no pageId information in DBus signal. Nothing -> showTooltip tooltipPoint@@ -567,11 +564,12 @@ -- Adjust tab name. pageModeDuplicateTabList <- getDuplicateTabList- if modeName `elem` pageModeDuplicateTabList- -- Just strip tab name when current page mode in 'pageModeDuplicateTabList'- then modifyTVarIO bufferListTVar (bufferListStripName modeName pageId path)- -- Otherwise unique all tab names.- else modifyTVarIO bufferListTVar (bufferListUniqueName modeName)+ modifyTVarIO bufferListTVar + (if modeName `elem` pageModeDuplicateTabList+ -- Just strip tab name when current page mode in 'pageModeDuplicateTabList'+ then bufferListStripName modeName pageId path+ -- Otherwise unique all tab names.+ else bufferListUniqueName modeName) -- Update buffer history. bufferList <- readTVarIO bufferListTVar@@ -661,9 +659,7 @@ interactiveName = (fst . head) list title = (snd . head) list -- Show interactivebar.- interactivebarSetTitle interactivebar title- interactivebarSetContent interactivebar "" -- clean input- uiFrameShowInteractivebar uiFrame+ uiFrameInit uiFrame title "" -- When PopupWindow is invisible startup anythingView process. whenM (not <$> popupWindowIsVisible popupWindow) (do@@ -700,8 +696,7 @@ tryTakeMVar (envGlobalInteractiveLock env) -- Get interactive name and title.- let interactiveName = (fst . head) strList- interactiveTitle = (snd . head) strList+ let (interactiveName, interactiveTitle) = head strList case focusStatus of FocusInitInteractivebar -> do@@ -722,9 +717,7 @@ getCurrentUIFrame env >?>= \uiFrame -> do -- Show interactivebar. let interactivebar = uiFrameInteractivebar uiFrame- interactivebarSetTitle interactivebar interactiveTitle- interactivebarSetContent interactivebar ""- uiFrameShowInteractivebar uiFrame+ uiFrameInit uiFrame interactiveTitle "" -- When PopupWindow is invisible startup anythingView process. whenM (not <$> popupWindowIsVisible popupWindow) (do
Manatee/UI/FocusNotifier.hs view
@@ -81,12 +81,7 @@ (Rectangle x y w h) <- widgetGetAllocation widget -- get widget size. frameWin <- widgetGetDrawWindow widget -- get draw window renderWithDrawable frameWin $ -- draw highlight frame- focusNotifierDraw - (integralToDouble x) - (integralToDouble y) - (integralToDouble w) - (integralToDouble h)- (integralToDouble focusNotifierSize)+ focusNotifierDraw (i2d x) (i2d y) (i2d w) (i2d h) (i2d focusNotifierSize) -- Delete FocusNotifier when widget is destroy. widget `on` destroyEvent $ tryEvent $ liftIO $
Manatee/UI/UIFrame.hs view
@@ -91,6 +91,14 @@ return $ UIFrame box interactivebar frame outputbar statusbar notebookTab +-- | UIFrame init.+uiFrameInit :: UIFrame -> String -> String -> IO ()+uiFrameInit uiFrame title content = + interactivebarInit (uiFrameInteractivebar uiFrame)+ (uiFrameBox uiFrame)+ title+ content+ -- | Show interactivebar. uiFrameShowInteractivebar :: UIFrame -> IO () uiFrameShowInteractivebar uiFrame =
Manatee/UI/WindowNode.hs view
@@ -46,7 +46,8 @@ windowNodeNewInternal (vId, pId, clId, crId, typ, direction) (windowNodeList, container) = runStateT_ nodeList $ do -- Create new window node.- windowNode <- lift $ WindowNode id+ windowNode <- + lift $ WindowNode id <$> windowNodePanedNew direction <*> newTVarIO pId <*> newTVarIO clId@@ -319,7 +320,6 @@ | zoomDirection == ZDown = (ZUp, if isEnlarge then zoomDefaultSize else -zoomDefaultSize) | zoomDirection == ZLeft = (ZRight, if isEnlarge then -zoomDefaultSize else zoomDefaultSize) | otherwise = (ZLeft, if isEnlarge then zoomDefaultSize else -zoomDefaultSize)- -- | Zoom window. windowNodeZoom :: WindowNodeList -> WindowNode -> ZoomDirection -> Bool -> IO ()
manatee.cabal view
@@ -1,5 +1,5 @@ name: manatee-version: 0.0.5+version: 0.0.6 Cabal-Version: >= 1.6 license: GPL-3 license-file: LICENSE@@ -55,8 +55,9 @@ . You can find simple manual at <http://haskell.org/haskellwiki/Manatee> .- Now Manatee looks can't work in XMonad, i'm working on it.- It's no problem if you use Gnome.+ Manatee can work in Gnome or KDE+ .+ Unfortunately, Manatee can't work in XMonad, please let me know if some XMonad hacker know how to fix it. :) . author: Andy Stewart maintainer: Andy Stewart <lazycat.manatee@gmail.com>@@ -92,7 +93,7 @@ other-modules: executable manatee- build-depends: base >=4 && < 5, manatee-core >= 0.0.1, containers >= 0.3.0.0, unix >= 2.4.0.0,+ build-depends: base >=4 && < 5, manatee-core >= 0.0.2, containers >= 0.3.0.0, unix >= 2.4.0.0, mtl >= 1.1.0.2, gtk-serialized-event >= 0.12.0, text >= 0.7.1.0, utf8-string, gtk >= 0.12.0, dbus-client >= 0.3 && < 0.4, stm, cairo >= 0.12.0, directory, dbus-core, template-haskell
repos.sh view
@@ -49,7 +49,7 @@ ;; changes) darcs changes --last 10 ;;- release) rm ./dist/*.tar.gz && cabal sdist && cabal upload ./dist/*.tar.gz+ release) rm ./dist/*.tar.gz || cabal sdist && cabal upload ./dist/*.tar.gz ;; *) echo "Unknown command: $CMD"; echo $USAGE; exit 1 ;;