Skip to content

Commit

Permalink
Merge pull request #858 from dcousens/fix-min-width
Browse files Browse the repository at this point in the history
Fix minimum widths for Shrink and Expand
  • Loading branch information
slotThe authored Dec 23, 2023
2 parents c01cd3a + cd32cac commit 5ceaed8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions XMonad/Layout/TwoPane.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ instance LayoutClass TwoPane a where

handleMessage (TwoPane delta split) x =
return $ case fromMessage x of
Just Shrink -> Just (TwoPane delta (split - delta))
Just Expand -> Just (TwoPane delta (split + delta))
Just Shrink -> Just (TwoPane delta (max 0 (split - delta)))
Just Expand -> Just (TwoPane delta (min 1 (split + delta)))
_ -> Nothing

description _ = "TwoPane"
4 changes: 2 additions & 2 deletions XMonad/Layout/TwoPanePersistent.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ instance (Show a, Eq a) => LayoutClass TwoPanePersistent a where

pureMessage (TwoPanePersistent w delta split) x =
case fromMessage x of
Just Shrink -> Just (TwoPanePersistent w delta (split - delta))
Just Expand -> Just (TwoPanePersistent w delta (split + delta))
Just Shrink -> Just (TwoPanePersistent w delta (max 0 (split - delta)))
Just Expand -> Just (TwoPanePersistent w delta (min 1 (split + delta)))
_ -> Nothing

description _ = "TwoPanePersistent"
Expand Down

0 comments on commit 5ceaed8

Please sign in to comment.