Skip to content

Commit

Permalink
X.L.TwoPane[Persistent]: Add minimum widths for Shrink and Expand
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens authored and slotThe committed Dec 23, 2023
1 parent c01cd3a commit cd32cac
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 cd32cac

Please sign in to comment.