vty 5.15.1 → 5.16
raw patch · 5 files changed
+54/−30 lines, 5 filesdep ~base
Dependency ranges changed: base
Files
- CHANGELOG.md +10/−0
- src/Graphics/Vty/Image.hs +14/−8
- src/Graphics/Vty/Input/Events.hs +1/−1
- src/Graphics/Vty/Input/Mouse.hs +9/−1
- vty.cabal +20/−20
CHANGELOG.md view
@@ -1,3 +1,13 @@+5.16+API changes:+ - Added support for mouse wheel events while in mouse mode. The Button+ type got two new constructors as a result: BScrollUp and BScrollDown.+ Thanks to doublescale@tutanota.com for this contribution!++Bug fixes:+ - charFill now clamps negative arguments to zero (thanks Eric+ Mertens!)+ 5.15.1 Package changes: - Documentation files are now marked accordingly (thanks Michal
src/Graphics/Vty/Image.hs view
@@ -171,6 +171,9 @@ utf8Bytestring' a bs = text' a (T.decodeUtf8 bs) -- | Make an image filling a region with the specified character.+--+-- If either the width or height are less than or equal to 0, then+-- the result is the empty image. charFill :: Integral d => Attr -- ^ The attribute to use.@@ -181,14 +184,17 @@ -> d -- ^ The region height. -> Image-charFill _a _c 0 _h = EmptyImage-charFill _a _c _w 0 = EmptyImage-charFill a c w h =- vertCat $ replicate (fromIntegral h) $ HorizText a txt displayWidth charWidth- where- txt = TL.replicate (fromIntegral w) (TL.singleton c)- displayWidth = safeWcwidth c * (fromIntegral w)- charWidth = fromIntegral w+charFill a c w h+ | w <= 0 || h <= 0 = EmptyImage+ | otherwise = vertCat+ $ replicate (fromIntegral h)+ $ HorizText a txt displayWidth charWidth+ where+ txt = TL.replicate charWidth (TL.singleton c)+ displayWidth = safeWcwidth c * charWidth++ charWidth :: Num a => a+ charWidth = fromIntegral w -- | The empty image. Useful for fold combinators. These occupy no space -- and do not affect display attributes.
src/Graphics/Vty/Input/Events.hs view
@@ -28,7 +28,7 @@ deriving (Eq,Show,Read,Ord,Generic) -- | Mouse buttons.-data Button = BLeft | BMiddle | BRight+data Button = BLeft | BMiddle | BRight | BScrollUp | BScrollDown deriving (Eq,Show,Read,Ord,Generic) -- | Events.
src/Graphics/Vty/Input/Mouse.hs view
@@ -67,7 +67,7 @@ -- These bits indicate the buttons involved: buttonMask :: Int-buttonMask = 3+buttonMask = 67 leftButton :: Int leftButton = 0@@ -78,6 +78,12 @@ rightButton :: Int rightButton = 2 +scrollUp :: Int+scrollUp = 64++scrollDown :: Int+scrollDown = 65+ hasBitSet :: Int -> Int -> Bool hasBitSet val bit = val .&. bit > 0 @@ -100,6 +106,8 @@ let buttonMap = [ (leftButton, BLeft) , (middleButton, BMiddle) , (rightButton, BRight)+ , (scrollUp, BScrollUp)+ , (scrollDown, BScrollDown) ] in case lookup (mods .&. buttonMask) buttonMap of Nothing -> failParse
vty.cabal view
@@ -1,5 +1,5 @@ name: vty-version: 5.15.1+version: 5.16 license: BSD3 license-file: LICENSE author: AUTHORS@@ -38,7 +38,7 @@ library default-language: Haskell2010- build-depends: base >= 4.6 && < 5,+ build-depends: base >= 4.8 && < 5, blaze-builder >= 0.3.3.2 && < 0.5, bytestring, containers,@@ -125,7 +125,7 @@ ghc-options: -threaded build-depends: vty,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, containers, microlens, microlens-mtl,@@ -140,7 +140,7 @@ ghc-options: -threaded build-depends: vty,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, containers, microlens, microlens-mtl,@@ -156,7 +156,7 @@ Cabal >= 1.20, QuickCheck >= 2.7, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,@@ -188,7 +188,7 @@ Cabal >= 1.20, QuickCheck >= 2.7, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,@@ -221,7 +221,7 @@ Cabal >= 1.20, QuickCheck >= 2.7, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,@@ -254,7 +254,7 @@ Cabal >= 1.20, QuickCheck >= 2.7, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,@@ -280,7 +280,7 @@ Cabal >= 1.20, QuickCheck >= 2.7, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,@@ -307,7 +307,7 @@ Cabal >= 1.20, QuickCheck >= 2.7, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, blaze-builder >= 0.3.3.2 && < 0.5, bytestring, containers,@@ -337,7 +337,7 @@ Cabal >= 1.20, QuickCheck >= 2.7, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,@@ -365,7 +365,7 @@ Cabal >= 1.20, QuickCheck >= 2.7, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,@@ -392,7 +392,7 @@ Cabal >= 1.20, QuickCheck >= 2.7, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,@@ -420,7 +420,7 @@ Cabal >= 1.20, QuickCheck >= 2.7, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,@@ -452,7 +452,7 @@ Cabal >= 1.20, QuickCheck >= 2.7, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,@@ -484,7 +484,7 @@ Cabal >= 1.20, QuickCheck >= 2.7, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,@@ -516,7 +516,7 @@ Cabal >= 1.20, QuickCheck >= 2.7, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,@@ -542,7 +542,7 @@ Cabal >= 1.20, QuickCheck >= 2.7, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,@@ -570,7 +570,7 @@ test-framework == 0.8.*, test-framework-smallcheck == 0.2.*, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,@@ -606,7 +606,7 @@ test-framework-smallcheck == 0.2.*, test-framework-hunit, random >= 1.0 && < 1.2,- base >= 4.6 && < 5,+ base >= 4.8 && < 5, bytestring, containers, deepseq >= 1.1 && < 1.5,