aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2008-03-25 22:02:11 +0100
committerDavid Roundy <droundy@darcs.net>2008-03-25 22:02:11 +0100
commit4a5742b40b408262659e08ef2c57f0da4a9d52d5 (patch)
treec82f283c2fc83bafb979041a566a254c8044c294
parent4d23441b1277c116900437184c3e62db1cf9fae0 (diff)
downloadXMonadContrib-4a5742b40b408262659e08ef2c57f0da4a9d52d5.tar.gz
XMonadContrib-4a5742b40b408262659e08ef2c57f0da4a9d52d5.tar.xz
XMonadContrib-4a5742b40b408262659e08ef2c57f0da4a9d52d5.zip
fix bug leading to gaps in tabs at the corner of the screen.
Besides being ugly, this had the effect of making me fail to click on the tab I aimed for, if it was in the corner. darcs-hash:20080325210211-72aca-1a12224aed3e54ae72f2ba9c0667e4e8690d6629.gz
-rw-r--r--XMonad/Layout/Tabbed.hs18
1 files changed, 7 insertions, 11 deletions
diff --git a/XMonad/Layout/Tabbed.hs b/XMonad/Layout/Tabbed.hs
index d8e3058..1dc6524 100644
--- a/XMonad/Layout/Tabbed.hs
+++ b/XMonad/Layout/Tabbed.hs
@@ -108,19 +108,15 @@ instance Eq a => DecorationStyle TabbedDecoration a where
describeDeco TabbedBottom = "Tabbed Bottom"
decorationMouseDragHook _ _ _ = return ()
pureDecoration ds _ ht _ s wrs (w,r@(Rectangle x y wh hh)) =
- if length wrs' <= 1
+ if length ws <= 1
then Nothing
else Just $ case ds of
- Tabbed -> Rectangle nx y nwh (fi ht)
- TabbedBottom -> Rectangle nx (y+fi(hh-ht)) nwh (fi ht)
-
- where wrs' = filter ((==r) . snd) wrs
- ws = map fst wrs'
- nwh = wh `div` max 1 (fi $ length wrs')
- nx = case elemIndex w $ filter (`elem` ws) (S.integrate s) of
- Just i -> x + (fi nwh * fi i)
- Nothing -> x
-
+ Tabbed -> Rectangle nx y wid (fi ht)
+ TabbedBottom -> Rectangle nx (y+fi(hh-ht)) wid (fi ht)
+ where ws = filter (`elem` map fst (filter ((==r) . snd) wrs)) (S.integrate s)
+ loc i = (wh * fi i) `div` max 1 (fi $ length ws)
+ wid = maybe (fi x) (\i -> loc (i+1) - loc i) $ w `elemIndex` ws
+ nx = maybe x (fi . loc) $ w `elemIndex` ws
shrink ds (Rectangle _ _ _ dh) (Rectangle x y w h) = case ds of
Tabbed -> Rectangle x (y + fi dh) w (h - dh)
TabbedBottom -> Rectangle x y w (h - dh)