diff options
author | Devin Mullins <me@twifkak.com> | 2008-05-12 10:53:38 +0200 |
---|---|---|
committer | Devin Mullins <me@twifkak.com> | 2008-05-12 10:53:38 +0200 |
commit | a9a4a6396cb32b9963dabad8d5042a7e60f8199b (patch) | |
tree | e480c2cc71ff3cebf2560aa37626f2ce2935f4e3 | |
parent | 35b89902b8711a85deabe798c4ab76e149b00b2f (diff) | |
download | XMonadContrib-a9a4a6396cb32b9963dabad8d5042a7e60f8199b.tar.gz XMonadContrib-a9a4a6396cb32b9963dabad8d5042a7e60f8199b.tar.xz XMonadContrib-a9a4a6396cb32b9963dabad8d5042a7e60f8199b.zip |
X.A.WindowNavigation: clarity
darcs-hash:20080512085338-78224-b662b943102da2c00bc5980aa767fec5032c4cb2.gz
-rw-r--r-- | XMonad/Actions/WindowNavigation.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/XMonad/Actions/WindowNavigation.hs b/XMonad/Actions/WindowNavigation.hs index b380e7b..2c022e1 100644 --- a/XMonad/Actions/WindowNavigation.hs +++ b/XMonad/Actions/WindowNavigation.hs @@ -36,6 +36,7 @@ import Data.List (sortBy) import Data.Map (Map()) import qualified Data.Map as M import Data.Maybe (catMaybes, fromMaybe, listToMaybe) +import Data.Ord (comparing) import Graphics.X11.Xlib -- $usage @@ -181,7 +182,7 @@ inr L (P a x) (Rectangle b l c w) = x >= fromIntegral l && x < fromIntegral l + a > fromIntegral b + fromIntegral c sortby :: Direction -> [(a,Rectangle)] -> [(a,Rectangle)] -sortby U = sortBy (\(_,Rectangle _ y _ _) (_,Rectangle _ y' _ _) -> compare y' y) -sortby D = sortBy (\(_,Rectangle _ y _ _) (_,Rectangle _ y' _ _) -> compare y y') -sortby R = sortBy (\(_,Rectangle x _ _ _) (_,Rectangle x' _ _ _) -> compare x x') -sortby L = sortBy (\(_,Rectangle x _ _ _) (_,Rectangle x' _ _ _) -> compare x' x) +sortby D = sortBy $ comparing (rect_y . snd) +sortby R = sortBy $ comparing (rect_x . snd) +sortby U = reverse . sortby D +sortby L = reverse . sortby R |