diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-03-26 11:50:34 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-03-26 11:50:34 +0200 |
commit | 3de5d5eaf59f39d5cab8457937e240427c65bcbe (patch) | |
tree | 0800a19f90a29f0b4870dd95febc4a97858cb23e | |
parent | 73f20610cc79c7de4b814e1acb1e1f1c02a7c22f (diff) | |
download | xmonad-3de5d5eaf59f39d5cab8457937e240427c65bcbe.tar.gz xmonad-3de5d5eaf59f39d5cab8457937e240427c65bcbe.tar.xz xmonad-3de5d5eaf59f39d5cab8457937e240427c65bcbe.zip |
Restrain leftWidth
darcs-hash:20070326095034-a5988-5f1abf81e8f5fbc9844dd62494cd1ffdd38066ed.gz
Diffstat (limited to '')
-rw-r--r-- | Operations.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Operations.hs b/Operations.hs index 393c25b..b70f151 100644 --- a/Operations.hs +++ b/Operations.hs @@ -64,7 +64,8 @@ switchLayout = do -- | changeWidth. Change the width of the main window in tiling mode. changeWidth :: Rational -> X () changeWidth delta = do - modify (\s -> s {leftWidth = leftWidth s + delta}) + -- the min/max stuff is to make sure that 0 <= leftWidth <= 1 + modify (\s -> s {leftWidth = min 1 $ max 0 $ leftWidth s + delta}) refresh -- | windows. Modify the current window list with a pure function, and refresh |