summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/X11/Draw.hs
diff options
context:
space:
mode:
authorUnoqwy <julien.qwy@gmail.com>2020-07-29 20:26:20 +0200
committerUnoqwy <julien.qwy@gmail.com>2020-08-07 19:49:33 +0200
commit56c62a01ff6e4b7a8f400e7cd0f62aa6817f4f8b (patch)
treea3cbbfad8fffd87d50b4983fc5f889f8d2c365ea /src/Xmobar/X11/Draw.hs
parentba7b3155e0c3c9ff1da914322fba74629c153f61 (diff)
downloadxmobar-56c62a01ff6e4b7a8f400e7cd0f62aa6817f4f8b.tar.gz
xmobar-56c62a01ff6e4b7a8f400e7cd0f62aa6817f4f8b.tar.bz2
make hlint happy
Diffstat (limited to 'src/Xmobar/X11/Draw.hs')
-rw-r--r--src/Xmobar/X11/Draw.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Xmobar/X11/Draw.hs b/src/Xmobar/X11/Draw.hs
index af8edc4..b28ca30 100644
--- a/src/Xmobar/X11/Draw.hs
+++ b/src/Xmobar/X11/Draw.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE CPP #-}
+{-# LANGUAGE TupleSections #-}
------------------------------------------------------------------------------
-- |
@@ -152,16 +153,16 @@ printStrings dr gc fontlist voffs offs a boxes sl@((s,c,i,l):xs) = do
let (ht',ay) = case (tBgTopOffset c, tBgBottomOffset c) of
(-1,_) -> (0, -1)
(_,-1) -> (0, -1)
- (ot,ob) -> ((fromIntegral ht) - ot - ob, ob)
+ (ot,ob) -> (fromIntegral ht - ot - ob, ob)
case s of
(Text t) -> liftIO $ printString d dr fontst gc fc bc offset valign ay ht' t alph
(Icon p) -> liftIO $ maybe (return ())
(B.drawBitmap d dr gc fc bc offset valign)
(lookup p (iconS r))
let triBoxes = tBoxes c
- dropBoxes = filter (\(_,b) -> not(b `elem` triBoxes)) boxes
+ dropBoxes = filter (\(_,b) -> b `notElem` triBoxes) boxes
boxes' = map (\((x1,_),b) -> ((x1, offset + l), b)) (filter (\(_,b) -> b `elem` triBoxes) boxes)
- ++ map (\b -> ((offset, offset + l), b)) (triBoxes \\ (map snd boxes))
+ ++ map ((offset, offset + l),) (triBoxes \\ map snd boxes)
if Prelude.null xs
then liftIO $ drawBoxes d dr gc (fromIntegral ht) (dropBoxes ++ boxes')
else liftIO $ drawBoxes d dr gc (fromIntegral ht) dropBoxes
@@ -192,9 +193,9 @@ drawBoxes d dr gc ht (b:bs) = do
drawBoxBorder :: Display -> Drawable -> GC -> BoxBorder -> Align -> Position -> Position -> (Position, Position) -> IO ()
drawBoxBorder d dr gc pos alg offset ht (x1,x2) = do
let (p1,p2) = case alg of
- L -> (0, (-offset))
- C -> (offset, (-offset))
- R -> (offset, 0 )
+ L -> (0, -offset)
+ C -> (offset, -offset)
+ R -> (offset, 0 )
case pos of
BBTop -> drawLine d dr gc (x1 + p1) 0 (x2 + p2) 0
BBBottom -> drawLine d dr gc (x1 + p1) (ht - 1) (x2 + p2) (ht - 1)