aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vogt <vogt.adam@gmail.com>2009-10-03 20:19:27 +0200
committerAdam Vogt <vogt.adam@gmail.com>2009-10-03 20:19:27 +0200
commitafdf0c9fbb8f390702fe45a16f6c0c3a17ca1606 (patch)
treedd98fe149d3228d30378583aa45f88a2bb237c5c
parentc11a6e9d11b994cc23aa096ff85c31c7a881283b (diff)
downloadXMonadContrib-afdf0c9fbb8f390702fe45a16f6c0c3a17ca1606.tar.gz
XMonadContrib-afdf0c9fbb8f390702fe45a16f6c0c3a17ca1606.tar.xz
XMonadContrib-afdf0c9fbb8f390702fe45a16f6c0c3a17ca1606.zip
Group functions in GridSelect haddock, add an inline screenshot.
Ignore-this: 3c6f1c5aff4fe197aa965cbda23e1be7 darcs-hash:20091003181927-1499c-47cad25da8ad20cafdf323d4871432d144b26c64.gz
-rw-r--r--XMonad/Actions/GridSelect.hs18
1 files changed, 14 insertions, 4 deletions
diff --git a/XMonad/Actions/GridSelect.hs b/XMonad/Actions/GridSelect.hs
index 5808447..81db676 100644
--- a/XMonad/Actions/GridSelect.hs
+++ b/XMonad/Actions/GridSelect.hs
@@ -17,10 +17,16 @@
module XMonad.Actions.GridSelect (
-- * Usage
-- $usage
+
+ -- * Configuration
GSConfig(..),
+ NavigateMap,
+ TwoDPosition,
defaultGSConfig,
defaultGSSpawnConfig,
buildDefaultGSConfig,
+
+ -- * Variations on 'gridselect'
gridselect,
gridselectWindow,
withSelectedWindow,
@@ -28,6 +34,8 @@ module XMonad.Actions.GridSelect (
goToSelected,
spawnSelected,
runSelectedAction,
+
+ -- * Utility functions for customizing the 'GSConfig'
fromClassName,
defaultColorizer,
colorRangeFromClassName
@@ -60,7 +68,9 @@ import Data.Word (Word8)
--
-- > , ((modMask x, xK_g), goToSelected defaultGSConfig)
--
--- Screenshot: <http://clemens.endorphin.org/gridselect.png>
+-- Screenshot:
+--
+-- <<http://www.haskell.org/sitewiki/images/3/35/Xmonad-gridselect-window-aavogt.png>>
--
-- This module also supports displaying arbitrary information in a grid and letting
-- the user select from it. E.g. to spawn an application from a given list, you
@@ -301,7 +311,7 @@ stringToRatio s = let gen = mkStdGen $ sum $ map fromEnum s
-- | Brings up a 2D grid of elements in the center of the screen, and one can
-- select an element with cursors keys. The selected element is returned.
-gridselect :: forall a . GSConfig a -> [(String,a)] -> X (Maybe a)
+gridselect :: GSConfig a -> [(String,a)] -> X (Maybe a)
gridselect gsconfig elmap =
withDisplay $ \dpy -> do
rootw <- asks theRoot
@@ -317,8 +327,7 @@ gridselect gsconfig elmap =
screenHeight = toInteger $ rect_height s;
selectedElement <- if (status == grabSuccess) then
do
- let restriction :: Integer -> (GSConfig a -> Integer) -> Double
- restriction ss cs = ((fromInteger ss)/(fromInteger $ cs gsconfig)-1)/2
+ let restriction ss cs = ((fromInteger ss)/(fromInteger $ cs gsconfig)-1)/2
restrictX = floor $ restriction screenWidth gs_cellwidth
restrictY = floor $ restriction screenHeight gs_cellheight
originPosX = floor $ ((gs_originFractX gsconfig) - (1/2)) * 2 * fromIntegral restrictX
@@ -368,6 +377,7 @@ decorateName' :: Window -> X String
decorateName' w = do
fmap show $ getName w
+-- | The default 'GSConfig' to use when selecting windows.
defaultGSConfig :: GSConfig Window
defaultGSConfig = buildDefaultGSConfig fromClassName