diff options
author | Andrea Rossato <andrea.rossato@unibz.it> | 2008-03-02 10:57:12 +0100 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@unibz.it> | 2008-03-02 10:57:12 +0100 |
commit | 1085043f0ceb4a3f76e7fed3f9ddd0f2b59cb6c5 (patch) | |
tree | ac0600f88d017b024c50f43251ebdfff7363e496 /XMonad/Prompt.hs | |
parent | e832f8bfa00a9e1c094604ccaea9aa38ceed2bc9 (diff) | |
download | XMonadContrib-1085043f0ceb4a3f76e7fed3f9ddd0f2b59cb6c5.tar.gz XMonadContrib-1085043f0ceb4a3f76e7fed3f9ddd0f2b59cb6c5.tar.xz XMonadContrib-1085043f0ceb4a3f76e7fed3f9ddd0f2b59cb6c5.zip |
Font and XUtils: add UTF-8 support and various fixes related to XFT
- printStringXMF: use the background color for XFT fonts too
- textWidthXMF now returns the text width even with xft fonts
- textExtentsXMF will now return only the ascend and the descent of a
string.
- stringPosition now takes the display too
- add support for UTF-8 locales: if the contrib library is compiled
with the 'with_xft' or the 'with_utf8' option the prompt and the
decoration system will support UTF-8 locales - this requires
utf8-strings.
darcs-hash:20080302095712-32816-f3d6d06ff9d921288b1625e4bfd643013d2075ec.gz
Diffstat (limited to 'XMonad/Prompt.hs')
-rw-r--r-- | XMonad/Prompt.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs index 349d8c0..d1426a6 100644 --- a/XMonad/Prompt.hs +++ b/XMonad/Prompt.hs @@ -41,6 +41,8 @@ module XMonad.Prompt , splitInSubListsAt , breakAtSpace , uniqSort + , decodeInput + , encodeOutput ) where import XMonad hiding (config, io) @@ -336,7 +338,7 @@ keyPressHandle mask (ks,_) -- insert a character keyPressHandle _ (_,s) | s == "" = eventLoop handle - | otherwise = do insertString s + | otherwise = do insertString (decodeInput s) updateWindows eventLoop handle @@ -504,7 +506,7 @@ printPrompt drw = do ht = height c fsl <- io $ textWidthXMF (dpy st) fs f psl <- io $ textWidthXMF (dpy st) fs p - (_,asc,desc,_) <- io $ textExtentsXMF fs str + (asc,desc) <- io $ textExtentsXMF fs str let y = fi $ ((ht - fi (asc + desc)) `div` 2) + fi asc x = (asc + desc) `div` 2 @@ -571,7 +573,7 @@ getComplWinDim compl = do (x,y) = case position c of Top -> (0,ht) Bottom -> (0, (0 + rem_height - actual_height)) - (_,asc,desc,_) <- io $ textExtentsXMF fs $ head compl + (asc,desc) <- io $ textExtentsXMF fs $ head compl let yp = fi $ (ht + fi (asc - desc)) `div` 2 xp = (asc + desc) `div` 2 yy = map fi . take (fi actual_rows) $ [yp,(yp + ht)..] |