diff options
author | tulthix <tulthix@gmail.com> | 2021-11-02 19:31:18 -0500 |
---|---|---|
committer | tulthix <tulthix@gmail.com> | 2021-11-02 19:35:31 -0500 |
commit | 9d21a7dd818ece5247e2f75f13d588111e334d8c (patch) | |
tree | 75e11000996f68454f42e545872760b8776968a3 /src/Xmobar/X11/Draw.hs | |
parent | 8ca3cfced681ae6c069450cc6d0352910433d46b (diff) | |
download | xmobar-9d21a7dd818ece5247e2f75f13d588111e334d8c.tar.gz xmobar-9d21a7dd818ece5247e2f75f13d588111e334d8c.tar.bz2 |
hspace feature. Initial intent: make space for a tray
Diffstat (limited to 'src/Xmobar/X11/Draw.hs')
-rw-r--r-- | src/Xmobar/X11/Draw.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Xmobar/X11/Draw.hs b/src/Xmobar/X11/Draw.hs index 6044eff..1b3d4ee 100644 --- a/src/Xmobar/X11/Draw.hs +++ b/src/Xmobar/X11/Draw.hs @@ -60,6 +60,7 @@ drawInWin wr@(Rectangle _ _ wid ht) ~[left,center,right] = do getWidth (Text s,cl,i,_) = textWidth d (safeIndex fs i) s >>= \tw -> return (Text s,cl,i,fi tw) getWidth (Icon s,cl,i,_) = return (Icon s,cl,i,fi $ iconW s) + getWidth (Hspace p,cl,i,_) = return (Hspace p,cl,i,fi p) p <- liftIO $ createPixmap d w wid ht (defaultDepthOfScreen (defaultScreenOfDisplay d)) @@ -102,6 +103,7 @@ verticalOffset ht (Text t) fontst voffs _ verticalOffset ht (Icon _) _ _ conf | iconOffset conf > -1 = return $ fi (iconOffset conf) | otherwise = return $ fi (ht `div` 2) - 1 +verticalOffset _ (Hspace _) _ voffs _ = return $ fi voffs printString :: Display -> Drawable -> XFont -> GC -> String -> String -> Position -> Position -> Position -> Position -> String -> Int -> IO () @@ -160,6 +162,7 @@ printStrings dr gc fontlist voffs offs a boxes sl@((s,c,i,l):xs) = do (Icon p) -> liftIO $ maybe (return ()) (B.drawBitmap d dr gc fc bc offset valign) (lookup p (iconS r)) + (Hspace _) -> liftIO $ return () let triBoxes = tBoxes c dropBoxes = filter (\(_,b) -> b `notElem` triBoxes) boxes boxes' = map (\((x1,_),b) -> ((x1, offset + l), b)) (filter (\(_,b) -> b `elem` triBoxes) boxes) |