diff options
author | jao <jao@gnu.org> | 2015-03-20 02:27:57 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2015-03-20 02:27:57 +0100 |
commit | 90e6cd0407313858daef2eb6ecfd5cd04a2a72a8 (patch) | |
tree | 120b7fd7985217231615ce02a9f9391bc2d1baf3 /src/Window.hs | |
parent | bb406692011a78cb15414ec58e21487e927a597a (diff) | |
download | xmobar-90e6cd0407313858daef2eb6ecfd5cd04a2a72a8.tar.gz xmobar-90e6cd0407313858daef2eb6ecfd5cd04a2a72a8.tar.bz2 |
Fixes for vertical alignment and border drawing
Diffstat (limited to 'src/Window.hs')
-rw-r--r-- | src/Window.hs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Window.hs b/src/Window.hs index 95ad3a3..ffb3e45 100644 --- a/src/Window.hs +++ b/src/Window.hs @@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module : Window --- Copyright : (c) 2011-14 Jose A. Ortega Ruiz +-- Copyright : (c) 2011-15 Jose A. Ortega Ruiz -- : (c) 2012 Jochen Keil -- License : BSD-style (see LICENSE) -- @@ -171,15 +171,18 @@ drawBorder b lw d p gc c wi ht = case b of TopB -> drawBorder (TopBM 0) lw d p gc c wi ht BottomB -> drawBorder (BottomBM 0) lw d p gc c wi ht FullB -> drawBorder (FullBM 0) lw d p gc c wi ht - TopBM m -> sf >> sla >> drawLine d p gc 0 (fi m + boff) (fi wi) (fi m + boff) + TopBM m -> sf >> sla >> + drawLine d p gc 0 (fi m + boff) (fi wi) (fi m + boff) BottomBM m -> let rw = fi ht - fi m + boff in sf >> sla >> drawLine d p gc 0 rw (fi wi) rw - FullBM m -> let pad = 2 * fi m + 2 * fi boff'; mp = fi m + fi boff' in - sf >> sla >> drawRectangle d p gc mp mp (wi - pad) (ht - pad) + FullBM m -> let mp = fi m + pad = 2 * fi mp + fi lw + in sf >> sla >> + drawRectangle d p gc mp mp (wi - pad + 1) (ht - pad) where sf = setForeground d gc c sla = setLineAttributes d gc (fi lw) lineSolid capNotLast joinMiter boff = borderOffset b lw - boff' = calcBorderOffset lw :: Int +-- boff' = calcBorderOffset lw :: Int hideWindow :: Display -> Window -> IO () hideWindow d w = do @@ -209,4 +212,3 @@ borderOffset b lw = calcBorderOffset :: (Integral a) => Int -> a calcBorderOffset = ceiling . (/2) . toDouble where toDouble = fi :: (Integral a) => a -> Double - |