mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-15 04:05:53 -07:00
X.L.Magnifier: Implement magnifier['] in term of magnifiercz[']
This commit is contained in:
@@ -84,7 +84,7 @@ import XMonad.Util.XUtils
|
|||||||
|
|
||||||
-- | Increase the size of the window that has focus
|
-- | Increase the size of the window that has focus
|
||||||
magnifier :: l a -> ModifiedLayout Magnifier l a
|
magnifier :: l a -> ModifiedLayout Magnifier l a
|
||||||
magnifier = ModifiedLayout (Mag 1 (1.5,1.5) On All)
|
magnifier = magnifiercz 1.5
|
||||||
|
|
||||||
-- | Change the size of the window that has focus by a custom zoom
|
-- | Change the size of the window that has focus by a custom zoom
|
||||||
magnifiercz :: Rational -> l a -> ModifiedLayout Magnifier l a
|
magnifiercz :: Rational -> l a -> ModifiedLayout Magnifier l a
|
||||||
@@ -93,7 +93,12 @@ magnifiercz cz = ModifiedLayout (Mag 1 (fromRational cz, fromRational cz) On All
|
|||||||
-- | Increase the size of the window that has focus, unless if it is one of the
|
-- | Increase the size of the window that has focus, unless if it is one of the
|
||||||
-- master windows.
|
-- master windows.
|
||||||
magnifier' :: l a -> ModifiedLayout Magnifier l a
|
magnifier' :: l a -> ModifiedLayout Magnifier l a
|
||||||
magnifier' = ModifiedLayout (Mag 1 (1.5,1.5) On NoMaster)
|
magnifier' = magnifiercz' 1.5
|
||||||
|
|
||||||
|
-- | Increase the size of the window that has focus by a custom zoom,
|
||||||
|
-- unless if it is one of the the master windows.
|
||||||
|
magnifiercz' :: Rational -> l a -> ModifiedLayout Magnifier l a
|
||||||
|
magnifiercz' cz = ModifiedLayout (Mag 1 (fromRational cz, fromRational cz) On NoMaster)
|
||||||
|
|
||||||
-- | Magnifier that defaults to Off
|
-- | Magnifier that defaults to Off
|
||||||
magnifierOff :: l a -> ModifiedLayout Magnifier l a
|
magnifierOff :: l a -> ModifiedLayout Magnifier l a
|
||||||
@@ -103,11 +108,6 @@ magnifierOff = ModifiedLayout (Mag 1 (1.5,1.5) Off All)
|
|||||||
maxMagnifierOff :: l a -> ModifiedLayout Magnifier l a
|
maxMagnifierOff :: l a -> ModifiedLayout Magnifier l a
|
||||||
maxMagnifierOff = ModifiedLayout (Mag 1 (1000,1000) Off All)
|
maxMagnifierOff = ModifiedLayout (Mag 1 (1000,1000) Off All)
|
||||||
|
|
||||||
-- | Increase the size of the window that has focus by a custom zoom,
|
|
||||||
-- unless if it is one of the the master windows.
|
|
||||||
magnifiercz' :: Rational -> l a -> ModifiedLayout Magnifier l a
|
|
||||||
magnifiercz' cz = ModifiedLayout (Mag 1 (fromRational cz, fromRational cz) On NoMaster)
|
|
||||||
|
|
||||||
-- | A magnifier that greatly magnifies just the vertical direction
|
-- | A magnifier that greatly magnifies just the vertical direction
|
||||||
maximizeVertical :: l a -> ModifiedLayout Magnifier l a
|
maximizeVertical :: l a -> ModifiedLayout Magnifier l a
|
||||||
maximizeVertical = ModifiedLayout (Mag 1 (1,1000) Off All)
|
maximizeVertical = ModifiedLayout (Mag 1 (1,1000) Off All)
|
||||||
@@ -164,7 +164,7 @@ magnify (zoomx,zoomy) (Rectangle x y w h) = Rectangle x' y' w' h'
|
|||||||
|
|
||||||
fit :: Rectangle -> Rectangle -> Rectangle
|
fit :: Rectangle -> Rectangle -> Rectangle
|
||||||
fit (Rectangle sx sy sw sh) (Rectangle x y w h) = Rectangle x' y' w' h'
|
fit (Rectangle sx sy sw sh) (Rectangle x y w h) = Rectangle x' y' w' h'
|
||||||
where x' = max sx (x - (max 0 (x + fi w - sx - fi sw)))
|
where x' = max sx (x - max 0 (x + fi w - sx - fi sw))
|
||||||
y' = max sy (y - (max 0 (y + fi h - sy - fi sh)))
|
y' = max sy (y - max 0 (y + fi h - sy - fi sh))
|
||||||
w' = min sw w
|
w' = min sw w
|
||||||
h' = min sh h
|
h' = min sh h
|
||||||
|
Reference in New Issue
Block a user