From 793deacd432b8a3aeb227ffa3e7203a9ca0e5053 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Sun, 27 May 2007 14:59:28 +0200 Subject: mod-b, toggle on or off the status bar gap darcs-hash:20070527125928-9c5c1-a16246810db9d4abfe81d0d5814721b64f59a14c --- Operations.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Operations.hs') diff --git a/Operations.hs b/Operations.hs index 96727bb..10a5882 100644 --- a/Operations.hs +++ b/Operations.hs @@ -15,7 +15,7 @@ module Operations where import XMonad import qualified StackSet as W -import {-# SOURCE #-} Config (borderWidth,defaultMenuGap) +import {-# SOURCE #-} Config (borderWidth) import Data.Maybe import Data.List (genericIndex, intersectBy) @@ -67,6 +67,12 @@ shift n = withFocused hide >> windows (W.shift n) view :: WorkspaceId -> X () view = windows . W.view +-- | Modify the size of the status gap at the top of the screen +modifyGap :: (Int -> Int) -> X () +modifyGap f = do modify $ \s -> s { statusGap = max 0 (f (statusGap s)) } + refresh + + -- | Kill the currently focused client. If we do kill it, we'll get a -- delete notify back from X. -- @@ -123,7 +129,7 @@ hide w = withDisplay $ \d -> do -- refresh :: X () refresh = do - XState { windowset = ws, layouts = fls, xineScreens = xinesc } <- get + XState { windowset = ws, layouts = fls, xineScreens = xinesc, statusGap = gap } <- get d <- asks display -- for each workspace, layout the currently visible workspaces @@ -133,8 +139,8 @@ refresh = do Just l = fmap fst $ M.lookup n fls Rectangle sx sy sw sh = genericIndex xinesc (W.screen w) -- now tile the windows on this workspace - rs <- doLayout l (Rectangle sx (sy + fromIntegral defaultMenuGap) - sw (sh - fromIntegral defaultMenuGap)) (W.index this) + rs <- doLayout l (Rectangle sx (sy + fromIntegral gap) + sw (sh - fromIntegral gap)) (W.index this) mapM_ (\(win,rect) -> io (tileWindow d win rect)) rs -- and raise the focused window if there is one. -- cgit v1.2.3