summaryrefslogtreecommitdiffstats
path: root/Operations.hs
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-05-27 14:59:28 +0200
committerDon Stewart <dons@cse.unsw.edu.au>2007-05-27 14:59:28 +0200
commit793deacd432b8a3aeb227ffa3e7203a9ca0e5053 (patch)
treea0be2fddf283c6521ec3b8399ce61372c63b3532 /Operations.hs
parentfb64aaf78368b7edf3affcb6e1fe4c48327f62d0 (diff)
downloadmetatile-793deacd432b8a3aeb227ffa3e7203a9ca0e5053.tar
metatile-793deacd432b8a3aeb227ffa3e7203a9ca0e5053.zip
mod-b, toggle on or off the status bar gap
darcs-hash:20070527125928-9c5c1-a16246810db9d4abfe81d0d5814721b64f59a14c
Diffstat (limited to 'Operations.hs')
-rw-r--r--Operations.hs14
1 files changed, 10 insertions, 4 deletions
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.