{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, PatternGuards #-}
module XMonad.Layout.Spacing
(
Spacing (..)
, spacingRaw
, spacing, spacingWithEdge
, smartSpacing, smartSpacingWithEdge
, SpacingModifier (..)
, setSmartSpacing
, setScreenSpacing, setScreenSpacingEnabled
, setWindowSpacing, setWindowSpacingEnabled
, toggleSmartSpacing
, toggleScreenSpacingEnabled
, toggleWindowSpacingEnabled
, setScreenWindowSpacing
, incWindowSpacing, incScreenSpacing
, decWindowSpacing, decScreenSpacing
, incScreenWindowSpacing, decScreenWindowSpacing
, Border (..)
, borderMap, borderIncrementBy
) where
import XMonad
import XMonad.StackSet as W
import qualified XMonad.Util.Rectangle as R
import XMonad.Layout.LayoutModifier
import XMonad.Actions.MessageFeedback
data Border = Border
{ Border -> Integer
top :: Integer
, Border -> Integer
bottom :: Integer
, Border -> Integer
right :: Integer
, Border -> Integer
left :: Integer
} deriving (Int -> Border -> ShowS
[Border] -> ShowS
Border -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Border] -> ShowS
$cshowList :: [Border] -> ShowS
show :: Border -> String
$cshow :: Border -> String
showsPrec :: Int -> Border -> ShowS
$cshowsPrec :: Int -> Border -> ShowS
Show,ReadPrec [Border]
ReadPrec Border
Int -> ReadS Border
ReadS [Border]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Border]
$creadListPrec :: ReadPrec [Border]
readPrec :: ReadPrec Border
$creadPrec :: ReadPrec Border
readList :: ReadS [Border]
$creadList :: ReadS [Border]
readsPrec :: Int -> ReadS Border
$creadsPrec :: Int -> ReadS Border
Read)
data Spacing a = Spacing
{ forall a. Spacing a -> Bool
smartBorder :: Bool
, forall a. Spacing a -> Border
screenBorder :: Border
, forall a. Spacing a -> Bool
screenBorderEnabled :: Bool
, forall a. Spacing a -> Border
windowBorder :: Border
, forall a. Spacing a -> Bool
windowBorderEnabled :: Bool
} deriving (Int -> Spacing a -> ShowS
forall a. Int -> Spacing a -> ShowS
forall a. [Spacing a] -> ShowS
forall a. Spacing a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Spacing a] -> ShowS
$cshowList :: forall a. [Spacing a] -> ShowS
show :: Spacing a -> String
$cshow :: forall a. Spacing a -> String
showsPrec :: Int -> Spacing a -> ShowS
$cshowsPrec :: forall a. Int -> Spacing a -> ShowS
Show,ReadPrec [Spacing a]
ReadPrec (Spacing a)
ReadS [Spacing a]
forall a. ReadPrec [Spacing a]
forall a. ReadPrec (Spacing a)
forall a. Int -> ReadS (Spacing a)
forall a. ReadS [Spacing a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Spacing a]
$creadListPrec :: forall a. ReadPrec [Spacing a]
readPrec :: ReadPrec (Spacing a)
$creadPrec :: forall a. ReadPrec (Spacing a)
readList :: ReadS [Spacing a]
$creadList :: forall a. ReadS [Spacing a]
readsPrec :: Int -> ReadS (Spacing a)
$creadsPrec :: forall a. Int -> ReadS (Spacing a)
Read)
instance Eq a => LayoutModifier Spacing a where
modifyLayout :: forall (l :: * -> *).
LayoutClass l a =>
Spacing a
-> Workspace String (l a) a
-> Rectangle
-> X ([(a, Rectangle)], Maybe (l a))
modifyLayout (Spacing Bool
_b Border
_sb Bool
False Border
_wb Bool
_wbe) Workspace String (l a) a
wsp Rectangle
lr =
forall (layout :: * -> *) a.
LayoutClass layout a =>
Workspace String (layout a) a
-> Rectangle -> X ([(a, Rectangle)], Maybe (layout a))
runLayout Workspace String (l a) a
wsp Rectangle
lr
modifyLayout (Spacing Bool
b Border
sb Bool
_sbe Border
_wb Bool
_wbe) Workspace String (l a) a
wsp Rectangle
lr = do
let sb1 :: Border
sb1 = Border -> Border
borderClampGTZero Border
sb
lr' :: Rectangle
lr' = Border -> Integer -> Rectangle -> Rectangle
withBorder' Border
sb1 Integer
2 Rectangle
lr
sb2 :: Border
sb2 = Rectangle -> Rectangle -> Border
toBorder Rectangle
lr' Rectangle
lr
([(a, Rectangle)]
wrs,Maybe (l a)
ml) <- forall (layout :: * -> *) a.
LayoutClass layout a =>
Workspace String (layout a) a
-> Rectangle -> X ([(a, Rectangle)], Maybe (layout a))
runLayout Workspace String (l a) a
wsp Rectangle
lr'
let ff :: (a, Rectangle) -> (a, [(a, Rectangle)]) -> (a, [(a, Rectangle)])
ff (a
w,Rectangle
wr) (a
i,[(a, Rectangle)]
ps) = if a
w forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` (forall a. Maybe (Stack a) -> [a]
W.integrate' forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall i l a. Workspace i l a -> Maybe (Stack a)
W.stack forall a b. (a -> b) -> a -> b
$ Workspace String (l a) a
wsp)
then let wr' :: Rectangle
wr' = Border -> Integer -> Rectangle -> Rectangle
withBorder' Border
sb2 Integer
2 Rectangle
wr
in (a
iforall a. Num a => a -> a -> a
+a
1,(a
w,Rectangle
wr')forall a. a -> [a] -> [a]
:[(a, Rectangle)]
ps)
else let wr' :: Rectangle
wr' = Rectangle -> Rectangle -> Border -> Rectangle
moveByQuadrant Rectangle
lr Rectangle
wr Border
sb2
in (a
i,(a
w,Rectangle
wr')forall a. a -> [a] -> [a]
:[(a, Rectangle)]
ps)
(Integer
c,[(a, Rectangle)]
wrs') = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr forall {a}.
Num a =>
(a, Rectangle) -> (a, [(a, Rectangle)]) -> (a, [(a, Rectangle)])
ff (Integer
0::Integer,[]) [(a, Rectangle)]
wrs
forall (m :: * -> *) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ if Integer
c forall a. Ord a => a -> a -> Bool
<= Integer
1 Bool -> Bool -> Bool
&& Bool
b
then ([(a, Rectangle)]
wrs',Maybe (l a)
ml)
else ([(a, Rectangle)]
wrs,Maybe (l a)
ml)
where
moveByQuadrant :: Rectangle -> Rectangle -> Border -> Rectangle
moveByQuadrant :: Rectangle -> Rectangle -> Border -> Rectangle
moveByQuadrant Rectangle
rr mr :: Rectangle
mr@Rectangle{rect_x :: Rectangle -> Position
rect_x = Position
x, rect_y :: Rectangle -> Position
rect_y = Position
y} (Border Integer
bt Integer
bb Integer
br Integer
bl) =
let (Ratio Integer
rcx,Ratio Integer
rcy) = Rectangle -> (Ratio Integer, Ratio Integer)
R.center Rectangle
rr
(Ratio Integer
mcx,Ratio Integer
mcy) = Rectangle -> (Ratio Integer, Ratio Integer)
R.center Rectangle
mr
dx :: Integer
dx = forall a. Ordering -> (a, a, a) -> a
orderSelect (forall a. Ord a => a -> a -> Ordering
compare Ratio Integer
mcx Ratio Integer
rcx) (Integer
bl,Integer
0,forall a. Num a => a -> a
negate Integer
br)
dy :: Integer
dy = forall a. Ordering -> (a, a, a) -> a
orderSelect (forall a. Ord a => a -> a -> Ordering
compare Ratio Integer
mcy Ratio Integer
rcy) (Integer
bt,Integer
0,forall a. Num a => a -> a
negate Integer
bb)
in Rectangle
mr { rect_x :: Position
rect_x = Position
x forall a. Num a => a -> a -> a
+ forall a b. (Integral a, Num b) => a -> b
fromIntegral Integer
dx, rect_y :: Position
rect_y = Position
y forall a. Num a => a -> a -> a
+ forall a b. (Integral a, Num b) => a -> b
fromIntegral Integer
dy }
pureModifier :: Spacing a
-> Rectangle
-> Maybe (Stack a)
-> [(a, Rectangle)]
-> ([(a, Rectangle)], Maybe (Spacing a))
pureModifier (Spacing Bool
_b Border
_sb Bool
_sbe Border
_wb Bool
False) Rectangle
_lr Maybe (Stack a)
_mst [(a, Rectangle)]
wrs =
([(a, Rectangle)]
wrs, forall a. Maybe a
Nothing)
pureModifier (Spacing Bool
b Border
_sb Bool
_sbe Border
wb Bool
_wbe) Rectangle
_lr Maybe (Stack a)
mst [(a, Rectangle)]
wrs =
let wb' :: Border
wb' = Border -> Border
borderClampGTZero Border
wb
ff :: (a, Rectangle) -> (a, [(a, Rectangle)]) -> (a, [(a, Rectangle)])
ff p :: (a, Rectangle)
p@(a
w,Rectangle
wr) (a
i,[(a, Rectangle)]
ps) = if a
w forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` forall a. Maybe (Stack a) -> [a]
W.integrate' Maybe (Stack a)
mst
then let wr' :: Rectangle
wr' = Border -> Integer -> Rectangle -> Rectangle
withBorder' Border
wb' Integer
2 Rectangle
wr
in (a
iforall a. Num a => a -> a -> a
+a
1,(a
w,Rectangle
wr')forall a. a -> [a] -> [a]
:[(a, Rectangle)]
ps)
else (a
i,(a, Rectangle)
pforall a. a -> [a] -> [a]
:[(a, Rectangle)]
ps)
(Integer
c,[(a, Rectangle)]
wrs') = forall (t :: * -> *) a b.
Foldable t =>
(a -> b -> b) -> b -> t a -> b
foldr forall {a}.
Num a =>
(a, Rectangle) -> (a, [(a, Rectangle)]) -> (a, [(a, Rectangle)])
ff (Integer
0::Integer,[]) [(a, Rectangle)]
wrs
in if Integer
c forall a. Ord a => a -> a -> Bool
<= Integer
1 Bool -> Bool -> Bool
&& Bool
b
then ([(a, Rectangle)]
wrs, forall a. Maybe a
Nothing)
else ([(a, Rectangle)]
wrs', forall a. Maybe a
Nothing)
pureMess :: Spacing a -> SomeMessage -> Maybe (Spacing a)
pureMess s :: Spacing a
s@(Spacing Bool
b Border
sb Bool
sbe Border
wb Bool
wbe) SomeMessage
m
| Just (ModifySmartBorder Bool -> Bool
f) <- forall m. Message m => SomeMessage -> Maybe m
fromMessage SomeMessage
m
= forall a. a -> Maybe a
Just forall a b. (a -> b) -> a -> b
$ Spacing a
s { smartBorder :: Bool
smartBorder = Bool -> Bool
f Bool
b }
| Just (ModifyScreenBorder Border -> Border
f) <- forall m. Message m => SomeMessage -> Maybe m
fromMessage SomeMessage
m
= forall a. a -> Maybe a
Just forall a b. (a -> b) -> a -> b
$ Spacing a
s { screenBorder :: Border
screenBorder = Border -> Border
f Border
sb }
| Just (ModifyScreenBorderEnabled Bool -> Bool
f) <- forall m. Message m => SomeMessage -> Maybe m
fromMessage SomeMessage
m
= forall a. a -> Maybe a
Just forall a b. (a -> b) -> a -> b
$ Spacing a
s { screenBorderEnabled :: Bool
screenBorderEnabled = Bool -> Bool
f Bool
sbe }
| Just (ModifyWindowBorder Border -> Border
f) <- forall m. Message m => SomeMessage -> Maybe m
fromMessage SomeMessage
m
= forall a. a -> Maybe a
Just forall a b. (a -> b) -> a -> b
$ Spacing a
s { windowBorder :: Border
windowBorder = Border -> Border
f Border
wb }
| Just (ModifyWindowBorderEnabled Bool -> Bool
f) <- forall m. Message m => SomeMessage -> Maybe m
fromMessage SomeMessage
m
= forall a. a -> Maybe a
Just forall a b. (a -> b) -> a -> b
$ Spacing a
s { windowBorderEnabled :: Bool
windowBorderEnabled = Bool -> Bool
f Bool
wbe }
| Bool
otherwise
= forall a. Maybe a
Nothing
modifierDescription :: Spacing a -> String
modifierDescription Spacing {} =
String
"Spacing"
spacingRaw :: Bool
-> Border
-> Bool
-> Border
-> Bool
-> l a -> ModifiedLayout Spacing l a
spacingRaw :: forall (l :: * -> *) a.
Bool
-> Border
-> Bool
-> Border
-> Bool
-> l a
-> ModifiedLayout Spacing l a
spacingRaw Bool
b Border
sb Bool
sbe Border
wb Bool
wbe = forall (m :: * -> *) (l :: * -> *) a.
m a -> l a -> ModifiedLayout m l a
ModifiedLayout (forall a. Bool -> Border -> Bool -> Border -> Bool -> Spacing a
Spacing Bool
b Border
sb Bool
sbe Border
wb Bool
wbe)
data SpacingModifier
= ModifySmartBorder (Bool -> Bool)
| ModifyScreenBorder (Border -> Border)
| ModifyScreenBorderEnabled (Bool -> Bool)
| ModifyWindowBorder (Border -> Border)
| ModifyWindowBorderEnabled (Bool -> Bool)
instance Message SpacingModifier
setSmartSpacing :: Bool -> X ()
setSmartSpacing :: Bool -> X ()
setSmartSpacing = forall a. Message a => a -> X ()
sendMessage forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> Bool) -> SpacingModifier
ModifySmartBorder forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
setScreenSpacing :: Border -> X ()
setScreenSpacing :: Border -> X ()
setScreenSpacing = forall a. Message a => a -> X ()
sendMessage forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Border -> Border) -> SpacingModifier
ModifyScreenBorder forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
setScreenSpacingEnabled :: Bool -> X ()
setScreenSpacingEnabled :: Bool -> X ()
setScreenSpacingEnabled = forall a. Message a => a -> X ()
sendMessage forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> Bool) -> SpacingModifier
ModifyScreenBorderEnabled forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
setWindowSpacing :: Border -> X ()
setWindowSpacing :: Border -> X ()
setWindowSpacing = forall a. Message a => a -> X ()
sendMessage forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Border -> Border) -> SpacingModifier
ModifyWindowBorder forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
setWindowSpacingEnabled :: Bool -> X ()
setWindowSpacingEnabled :: Bool -> X ()
setWindowSpacingEnabled = forall a. Message a => a -> X ()
sendMessage forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Bool -> Bool) -> SpacingModifier
ModifyWindowBorderEnabled forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const
toggleSmartSpacing :: X ()
toggleSmartSpacing :: X ()
toggleSmartSpacing = forall a. Message a => a -> X ()
sendMessage forall a b. (a -> b) -> a -> b
$ (Bool -> Bool) -> SpacingModifier
ModifySmartBorder Bool -> Bool
not
toggleScreenSpacingEnabled :: X ()
toggleScreenSpacingEnabled :: X ()
toggleScreenSpacingEnabled = forall a. Message a => a -> X ()
sendMessage forall a b. (a -> b) -> a -> b
$ (Bool -> Bool) -> SpacingModifier
ModifyScreenBorderEnabled Bool -> Bool
not
toggleWindowSpacingEnabled :: X ()
toggleWindowSpacingEnabled :: X ()
toggleWindowSpacingEnabled = forall a. Message a => a -> X ()
sendMessage forall a b. (a -> b) -> a -> b
$ (Bool -> Bool) -> SpacingModifier
ModifyWindowBorderEnabled Bool -> Bool
not
setScreenWindowSpacing :: Integer -> X ()
setScreenWindowSpacing :: Integer -> X ()
setScreenWindowSpacing = forall a. Message a => [a] -> X ()
sendMessages forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a b. (a -> b) -> [a] -> [b]
map [(Border -> Border) -> SpacingModifier
ModifyWindowBorder,(Border -> Border) -> SpacingModifier
ModifyScreenBorder]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a. a -> a
id forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. a -> b -> a
const forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Border
uniformBorder
incWindowSpacing :: Integer -> X ()
incWindowSpacing :: Integer -> X ()
incWindowSpacing = forall a. Message a => a -> X ()
sendMessage forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Border -> Border) -> SpacingModifier
ModifyWindowBorder forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Border -> Border
borderIncrementBy
incScreenSpacing :: Integer -> X ()
incScreenSpacing :: Integer -> X ()
incScreenSpacing = forall a. Message a => a -> X ()
sendMessage forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Border -> Border) -> SpacingModifier
ModifyScreenBorder forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Border -> Border
borderIncrementBy
decWindowSpacing :: Integer -> X ()
decWindowSpacing :: Integer -> X ()
decWindowSpacing = Integer -> X ()
incWindowSpacing forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Num a => a -> a
negate
decScreenSpacing :: Integer -> X ()
decScreenSpacing :: Integer -> X ()
decScreenSpacing = Integer -> X ()
incScreenSpacing forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Num a => a -> a
negate
incScreenWindowSpacing :: Integer -> X ()
incScreenWindowSpacing :: Integer -> X ()
incScreenWindowSpacing = forall a. Message a => [a] -> X ()
sendMessages forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a b. (a -> b) -> [a] -> [b]
map [(Border -> Border) -> SpacingModifier
ModifyWindowBorder,(Border -> Border) -> SpacingModifier
ModifyScreenBorder]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b c. (a -> b -> c) -> b -> a -> c
flip forall a. a -> a
id forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> Border -> Border
borderIncrementBy
decScreenWindowSpacing :: Integer -> X ()
decScreenWindowSpacing :: Integer -> X ()
decScreenWindowSpacing = Integer -> X ()
incScreenWindowSpacing forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Num a => a -> a
negate
uniformBorder :: Integer -> Border
uniformBorder :: Integer -> Border
uniformBorder Integer
i = Integer -> Integer -> Integer -> Integer -> Border
Border Integer
i Integer
i Integer
i Integer
i
borderMap :: (Integer -> Integer) -> Border -> Border
borderMap :: (Integer -> Integer) -> Border -> Border
borderMap Integer -> Integer
f (Border Integer
t Integer
b Integer
r Integer
l) = Integer -> Integer -> Integer -> Integer -> Border
Border (Integer -> Integer
f Integer
t) (Integer -> Integer
f Integer
b) (Integer -> Integer
f Integer
r) (Integer -> Integer
f Integer
l)
borderClampGTZero :: Border -> Border
borderClampGTZero :: Border -> Border
borderClampGTZero = (Integer -> Integer) -> Border -> Border
borderMap (forall a. Ord a => a -> a -> a
max Integer
0)
borderIncrementBy :: Integer -> Border -> Border
borderIncrementBy :: Integer -> Border -> Border
borderIncrementBy Integer
i (Border Integer
t Integer
b Integer
r Integer
l) =
let bl :: [Integer]
bl = [Integer
t,Integer
b,Integer
r,Integer
l]
o :: Integer
o = forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
maximum [Integer]
bl
o' :: Integer
o' = forall a. Ord a => a -> a -> a
max Integer
i forall a b. (a -> b) -> a -> b
$ forall a. Num a => a -> a
negate Integer
o
in Integer -> Integer -> Integer -> Integer -> Border
Border (Integer
t forall a. Num a => a -> a -> a
+ Integer
o') (Integer
b forall a. Num a => a -> a -> a
+ Integer
o') (Integer
r forall a. Num a => a -> a -> a
+ Integer
o') (Integer
l forall a. Num a => a -> a -> a
+ Integer
o')
withBorder' :: Border -> Integer -> Rectangle -> Rectangle
withBorder' :: Border -> Integer -> Rectangle -> Rectangle
withBorder' (Border Integer
t Integer
b Integer
r Integer
l) = Integer
-> Integer
-> Integer
-> Integer
-> Integer
-> Rectangle
-> Rectangle
R.withBorder Integer
t Integer
b Integer
r Integer
l
toBorder :: Rectangle -> Rectangle -> Border
toBorder :: Rectangle -> Rectangle -> Border
toBorder Rectangle
r1 Rectangle
r2 =
let R.PointRectangle Integer
r1_x1 Integer
r1_y1 Integer
r1_x2 Integer
r1_y2 = Rectangle -> PointRectangle Integer
R.pixelsToCoordinates Rectangle
r1
R.PointRectangle Integer
r2_x1 Integer
r2_y1 Integer
r2_x2 Integer
r2_y2 = Rectangle -> PointRectangle Integer
R.pixelsToCoordinates Rectangle
r2
l :: Integer
l = Integer
r2_x1 forall a. Num a => a -> a -> a
- Integer
r1_x1
r :: Integer
r = Integer
r1_x2 forall a. Num a => a -> a -> a
- Integer
r2_x2
t :: Integer
t = Integer
r2_y1 forall a. Num a => a -> a -> a
- Integer
r1_y1
b :: Integer
b = Integer
r1_y2 forall a. Num a => a -> a -> a
- Integer
r2_y2
in Integer -> Integer -> Integer -> Integer -> Border
Border Integer
t Integer
b Integer
r Integer
l
orderSelect :: Ordering -> (a,a,a) -> a
orderSelect :: forall a. Ordering -> (a, a, a) -> a
orderSelect Ordering
o (a
lt,a
eq,a
gt) = case Ordering
o of
Ordering
LT -> a
lt
Ordering
EQ -> a
eq
Ordering
GT -> a
gt
spacing :: Int -> l a -> ModifiedLayout Spacing l a
spacing :: forall (l :: * -> *) a. Int -> l a -> ModifiedLayout Spacing l a
spacing Int
i = forall (l :: * -> *) a.
Bool
-> Border
-> Bool
-> Border
-> Bool
-> l a
-> ModifiedLayout Spacing l a
spacingRaw Bool
False (Integer -> Border
uniformBorder Integer
0) Bool
False (Integer -> Border
uniformBorder Integer
i') Bool
True
where i' :: Integer
i' = forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
i
spacingWithEdge :: Int -> l a -> ModifiedLayout Spacing l a
spacingWithEdge :: forall (l :: * -> *) a. Int -> l a -> ModifiedLayout Spacing l a
spacingWithEdge Int
i = forall (l :: * -> *) a.
Bool
-> Border
-> Bool
-> Border
-> Bool
-> l a
-> ModifiedLayout Spacing l a
spacingRaw Bool
False (Integer -> Border
uniformBorder Integer
i') Bool
True (Integer -> Border
uniformBorder Integer
i') Bool
True
where i' :: Integer
i' = forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
i
smartSpacing :: Int -> l a -> ModifiedLayout Spacing l a
smartSpacing :: forall (l :: * -> *) a. Int -> l a -> ModifiedLayout Spacing l a
smartSpacing Int
i = forall (l :: * -> *) a.
Bool
-> Border
-> Bool
-> Border
-> Bool
-> l a
-> ModifiedLayout Spacing l a
spacingRaw Bool
True (Integer -> Border
uniformBorder Integer
0) Bool
False (Integer -> Border
uniformBorder Integer
i') Bool
True
where i' :: Integer
i' = forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
i
smartSpacingWithEdge :: Int -> l a -> ModifiedLayout Spacing l a
smartSpacingWithEdge :: forall (l :: * -> *) a. Int -> l a -> ModifiedLayout Spacing l a
smartSpacingWithEdge Int
i = forall (l :: * -> *) a.
Bool
-> Border
-> Bool
-> Border
-> Bool
-> l a
-> ModifiedLayout Spacing l a
spacingRaw Bool
True (Integer -> Border
uniformBorder Integer
i') Bool
True (Integer -> Border
uniformBorder Integer
i') Bool
True
where i' :: Integer
i' = forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
i