mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 04:01:51 -07:00
improve the vertical centring in X.A.GridSelect
This commit is contained in:
@@ -10,6 +10,10 @@
|
||||
|
||||
### Bug Fixes and Minor Changes
|
||||
|
||||
* `XMonad.Actions.GridSelect`
|
||||
|
||||
- The vertical centring of text in each cell has been improved.
|
||||
|
||||
* `XMonad.Util.WindowProperties`
|
||||
|
||||
- Added the ability to test if a window has a tag from
|
||||
|
@@ -341,7 +341,10 @@ drawWinBox win font (fg,bg) bc ch cw text x y cp =
|
||||
(\n -> do size <- liftIO $ textWidthXMF dpy font n
|
||||
return $ size > (fromInteger (cw-(2*cp))))
|
||||
text
|
||||
printStringXMF dpy win font gc bg fg (fromInteger (x+cp)) (fromInteger (y+(div ch 2))) stext
|
||||
-- calculate the offset to vertically centre the text based on the ascender and descender
|
||||
(asc,desc) <- liftIO $ textExtentsXMF font stext
|
||||
let offset = ((ch - fromIntegral (asc + desc)) `div` 2) + fromIntegral asc
|
||||
printStringXMF dpy win font gc bg fg (fromInteger (x+cp)) (fromInteger (y+offset)) stext
|
||||
liftIO $ freeGC dpy gc
|
||||
liftIO $ freeGC dpy bordergc
|
||||
|
||||
|
Reference in New Issue
Block a user