diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Xmobar/X11/Draw.hs | 13 | ||||
| -rw-r--r-- | src/Xmobar/X11/Parsers.hs | 2 | 
2 files changed, 8 insertions, 7 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) diff --git a/src/Xmobar/X11/Parsers.hs b/src/Xmobar/X11/Parsers.hs index c25715c..7fa5c00 100644 --- a/src/Xmobar/X11/Parsers.hs +++ b/src/Xmobar/X11/Parsers.hs @@ -40,7 +40,7 @@ data BoxBorder = BBTop  data Box = Box BoxBorder Align Int32 CInt String deriving ( Eq )  instance Read Box where    readsPrec _ input = do -    let b = case (words input) of +    let b = case words input of               [pos]               -> Just $ Box (read pos) C 0 1 "white"               [pos,alg]           -> Just $ Box (read pos) (read alg) 0 1 "white"               [pos,alg,off]       -> Just $ Box (read pos) (read alg) (read off) 1 "white" | 
