diff options
author | Jan Vornberger <jan.vornberger@informatik.uni-oldenburg.de> | 2009-10-24 22:45:13 +0200 |
---|---|---|
committer | Jan Vornberger <jan.vornberger@informatik.uni-oldenburg.de> | 2009-10-24 22:45:13 +0200 |
commit | c2926c7f7543f3e79d6ecd841c0c55ea2454606a (patch) | |
tree | 61e42d93a119665346bed99cebaf90fb647ad767 /XMonad | |
parent | b2ac5a5056061a76bee34321dee0a9e109857f5e (diff) | |
download | XMonadContrib-c2926c7f7543f3e79d6ecd841c0c55ea2454606a.tar.gz XMonadContrib-c2926c7f7543f3e79d6ecd841c0c55ea2454606a.tar.xz XMonadContrib-c2926c7f7543f3e79d6ecd841c0c55ea2454606a.zip |
Added the alignment option 'AlignRightOffset'
Ignore-this: 58cc00e1be669877e38a97e36b924969
darcs-hash:20091024204513-594c5-0156243473792c90824835f7fc0cbc8b5078336c.gz
Diffstat (limited to 'XMonad')
-rw-r--r-- | XMonad/Util/Font.hsc | 3 | ||||
-rw-r--r-- | XMonad/Util/Loggers.hs | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/XMonad/Util/Font.hsc b/XMonad/Util/Font.hsc index 42de67d..5912053 100644 --- a/XMonad/Util/Font.hsc +++ b/XMonad/Util/Font.hsc @@ -143,7 +143,7 @@ textExtentsXMF (Xft xftfont) _ = io $ do #endif -- | String position -data Align = AlignCenter | AlignRight | AlignLeft +data Align = AlignCenter | AlignRight | AlignLeft | AlignRightOffset Int -- | Return the string x and y 'Position' in a 'Rectangle', given a -- 'FontStruct' and the 'Align'ment @@ -156,6 +156,7 @@ stringPosition dpy fs (Rectangle _ _ w h) al s = do AlignCenter -> fi (w `div` 2) - fi (width `div` 2) AlignLeft -> 1 AlignRight -> fi (w - (fi width + 1)); + AlignRightOffset offset -> fi (w - (fi width + 1)) - fi offset; return (x,y) printStringXMF :: (Functor m, MonadIO m) => Display -> Drawable -> XMonadFont -> GC -> String -> String diff --git a/XMonad/Util/Loggers.hs b/XMonad/Util/Loggers.hs index f8aef65..3065d30 100644 --- a/XMonad/Util/Loggers.hs +++ b/XMonad/Util/Loggers.hs @@ -254,7 +254,7 @@ fixedWidthL a str n logger = do case a of AlignCenter -> toL (take n $ padhalf l ++ l ++ cs) AlignRight -> toL (reverse (take n $ reverse l ++ cs)) - AlignLeft -> toL (take n $ l ++ cs) + _ -> toL (take n $ l ++ cs) where toL = return . Just cs = cycle str |