aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions
diff options
context:
space:
mode:
authorAdam Vogt <vogt.adam@gmail.com>2009-10-02 00:57:36 +0200
committerAdam Vogt <vogt.adam@gmail.com>2009-10-02 00:57:36 +0200
commitf3606efc44b3b039f4c5d4773e81298408942def (patch)
treecca163f04a5af34a6da497e1f6edd3cea21b7d5c /XMonad/Actions
parent3db3ce9071ead1ee0ebbedbeb23a77e4f2a7e152 (diff)
downloadXMonadContrib-f3606efc44b3b039f4c5d4773e81298408942def.tar.gz
XMonadContrib-f3606efc44b3b039f4c5d4773e81298408942def.tar.xz
XMonadContrib-f3606efc44b3b039f4c5d4773e81298408942def.zip
Use U.XUtils.fi to make WindowMenu clearer
Ignore-this: 63e73cd7c5de22b3e30e63c1e588e403 darcs-hash:20091001225736-1499c-f4a5094a0cd4b718906e34e8ad1c47f963acc37a.gz
Diffstat (limited to 'XMonad/Actions')
-rw-r--r--XMonad/Actions/WindowMenu.hs23
1 files changed, 11 insertions, 12 deletions
diff --git a/XMonad/Actions/WindowMenu.hs b/XMonad/Actions/WindowMenu.hs
index 6183c35..24858e7 100644
--- a/XMonad/Actions/WindowMenu.hs
+++ b/XMonad/Actions/WindowMenu.hs
@@ -25,6 +25,7 @@ import qualified XMonad.StackSet as W
import XMonad.Actions.GridSelect
import XMonad.Layout.Maximize
import XMonad.Layout.Minimize
+import XMonad.Util.XUtils (fi)
-- $usage
--
@@ -47,14 +48,12 @@ windowMenu = withFocused $ \w -> do
tags <- asks (workspaces . config)
Rectangle x y wh ht <- getSize w
Rectangle sx sy swh sht <- gets $ screenRect . W.screenDetail . W.current . windowset
- let originFractX = (fromIntegral x - fromIntegral sx + (fromIntegral wh / 2))
- / fromIntegral swh
- originFractY = (fromIntegral y -fromIntegral sy + (fromIntegral ht / 2))
- / fromIntegral sht
+ let originFractX = (fi x - fi sx + fi wh / 2) / fi swh
+ originFractY = (fi y - fi sy + fi ht / 2) / fi sht
colorizer = simpleColorizer nBC fBC
- gsConfig = buildDefaultGSConfig colorizer
- gsConfig' = gsConfig { gs_originFractX = originFractX,
- gs_originFractY = originFractY }
+ gsConfig = (buildDefaultGSConfig colorizer)
+ { gs_originFractX = originFractX
+ , gs_originFractY = originFractY }
actions = [ ("Cancel menu", return ())
, ("Close" , kill)
, ("Maximize" , sendMessage $ maximizeRestore w)
@@ -62,14 +61,14 @@ windowMenu = withFocused $ \w -> do
] ++
[ ("Move to " ++ tag, windows $ W.shift tag)
| tag <- tags ]
- runSelectedAction gsConfig' actions
+ runSelectedAction gsConfig actions
getSize :: Window -> X (Rectangle)
getSize w = do
d <- asks display
wa <- io $ getWindowAttributes d w
- let x = fromIntegral $ wa_x wa
- y = fromIntegral $ wa_y wa
- wh = fromIntegral $ wa_width wa
- ht = fromIntegral $ wa_height wa
+ let x = fi $ wa_x wa
+ y = fi $ wa_y wa
+ wh = fi $ wa_width wa
+ ht = fi $ wa_height wa
return (Rectangle x y wh ht)