vty-ui 1.6 → 1.6.1
raw patch · 14 files changed
+69/−14 lines, 14 filesdep ~QuickCheck
Dependency ranges changed: QuickCheck
Files
- LICENSE +1/−1
- doc/macros.tex +1/−1
- doc/title_page.tex +1/−1
- src/Graphics/Vty/Widgets/Borders.hs +2/−0
- src/Graphics/Vty/Widgets/Centering.hs +8/−0
- src/Graphics/Vty/Widgets/EventLoop.hs +22/−6
- src/Graphics/Vty/Widgets/Fills.hs +4/−0
- src/Graphics/Vty/Widgets/Fixed.hs +8/−0
- src/Graphics/Vty/Widgets/Group.hs +5/−0
- src/Graphics/Vty/Widgets/Limits.hs +8/−0
- src/Graphics/Vty/Widgets/List.hs +1/−1
- src/Graphics/Vty/Widgets/Padding.hs +3/−0
- src/Graphics/Vty/Widgets/ProgressBar.hs +1/−0
- vty-ui.cabal +4/−4
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2009-2011, Jonathan Daugherty.+Copyright (c) 2009-2013, Jonathan Daugherty. All rights reserved. Redistribution and use in source and binary forms, with or without
doc/macros.tex view
@@ -1,6 +1,6 @@ % Custom macros. -\newcommand{\vtyuiversion}{1.6}+\newcommand{\vtyuiversion}{1.6.1} \newcommand{\fw}[1]{\texttt{#1}} \newcommand{\vtyui}{\fw{vty-ui}}
doc/title_page.tex view
@@ -1,6 +1,6 @@ \title{\vtyui\ User's Manual} \author{ For \vtyui\ version \vtyuiversion\\- Jonathan Daugherty (\href{mailto:jtd@galois.com}{jtd@galois.com})+ Jonathan Daugherty (\href{mailto:cygnus@foobox.com}{cygnus@foobox.com}) } \maketitle
src/Graphics/Vty/Widgets/Borders.hs view
@@ -75,6 +75,7 @@ wRef <- newWidget initSt $ \w -> w { growHorizontal_ = const $ return True , render_ = renderHBorder+ , getCursorPosition_ = const $ return Nothing } return wRef @@ -125,6 +126,7 @@ let initSt = VBorder def_attr wRef <- newWidget initSt $ \w -> w { growVertical_ = const $ return True+ , getCursorPosition_ = const $ return Nothing , render_ = \this s ctx -> do VBorder attr <- getState this let attr' = mergeAttrs [ overrideAttr ctx
src/Graphics/Vty/Widgets/Centering.hs view
@@ -51,6 +51,10 @@ let (half, _) = centered_halves region_width s (region_width chSz) chPos = pos `plusWidth` half setCurrentPosition child chPos++ , getCursorPosition_ = \this -> do+ HCentered child <- getState this+ getCursorPosition child } wRef `relayKeyEvents` ch wRef `relayFocusEvents` ch@@ -90,6 +94,10 @@ let (half, _) = centered_halves region_height s (region_height chSz) chPos = pos `plusHeight` half setCurrentPosition child chPos++ , getCursorPosition_ = \this -> do+ VCentered child <- getState this+ getCursorPosition child } wRef `relayKeyEvents` ch wRef `relayFocusEvents` ch
src/Graphics/Vty/Widgets/EventLoop.hs view
@@ -83,13 +83,29 @@ set_cursor_pos (terminal vty) w h Nothing -> hide_cursor $ terminal vty - evt <- atomically $ readTChan chan+ -- Get the next event(s) in the queue. Returns all available events;+ -- blocks until at least one event is available.+ let getNextEvents = do+ evt <- readTChan chan+ em <- isEmptyTChan chan+ case em of+ True -> return [evt]+ False -> do+ rest <- getNextEvents+ return $ evt : rest - cont <- case evt of- VTYEvent (EvKey k mods) -> handleKeyEvent fg k mods >> return True- VTYEvent _ -> return True- UserEvent (ScheduledAction act) -> act >> return True- ShutdownUi -> return False+ evts <- atomically getNextEvents++ let processEvent lastCont evt = do+ if not lastCont then+ return False else+ case evt of+ VTYEvent (EvKey k mods) -> handleKeyEvent fg k mods >> return True+ VTYEvent _ -> return True+ UserEvent (ScheduledAction act) -> act >> return True+ ShutdownUi -> return False++ cont <- foldM processEvent True evts when cont $ runUi' vty chan collection ctx
src/Graphics/Vty/Widgets/Fills.hs view
@@ -29,6 +29,8 @@ , normalAttr ctx ] return $ char_fill attr' ch (region_width s) (region_height s)++ , getCursorPosition_ = const $ return Nothing } return wRef @@ -48,5 +50,7 @@ , normalAttr ctx ] return $ char_fill attr' ch (region_width s) (toEnum height)++ , getCursorPosition_ = const $ return Nothing } return wRef
src/Graphics/Vty/Widgets/Fixed.hs view
@@ -49,6 +49,10 @@ \this pos -> do HFixed _ ch <- getState this setCurrentPosition ch pos++ , getCursorPosition_ = \this -> do+ HFixed _ ch <- getState this+ getCursorPosition ch } wRef `relayKeyEvents` child wRef `relayFocusEvents` child@@ -82,6 +86,10 @@ \this pos -> do VFixed _ ch <- getState this setCurrentPosition ch pos++ , getCursorPosition_ = \this -> do+ VFixed _ ch <- getState this+ getCursorPosition ch } wRef `relayKeyEvents` child wRef `relayFocusEvents` child
src/Graphics/Vty/Widgets/Group.hs view
@@ -39,6 +39,11 @@ \this -> getCursorPosition =<< currentEntry this + , setCurrentPosition_ =+ \this pos -> do+ e <- currentEntry this+ setCurrentPosition e pos+ , growHorizontal_ = \this -> growHorizontal $ currentEntry' this
src/Graphics/Vty/Widgets/Limits.hs view
@@ -46,6 +46,10 @@ \this pos -> do HLimit _ ch <- getState this setCurrentPosition ch pos++ , getCursorPosition_ = \this -> do+ HLimit _ ch <- getState this+ getCursorPosition ch } wRef `relayKeyEvents` child wRef `relayFocusEvents` child@@ -73,6 +77,10 @@ \this pos -> do VLimit _ ch <- getState this setCurrentPosition ch pos++ , getCursorPosition_ = \this -> do+ VLimit _ ch <- getState this+ getCursorPosition ch } wRef `relayKeyEvents` child wRef `relayFocusEvents` child
src/Graphics/Vty/Widgets/List.hs view
@@ -269,7 +269,7 @@ , scrollTopIndex = newScrollTop } - notifyItemAddHandler list (numItems + 1) key w+ notifyItemAddHandler list (min numItems pos) key w when (numItems == 0) $ do
src/Graphics/Vty/Widgets/Padding.hs view
@@ -153,6 +153,9 @@ setCurrentPosition child newPos + , getCursorPosition_ = \this -> do+ Padded child _ <- getState this+ getCursorPosition child } wRef `relayKeyEvents` ch
src/Graphics/Vty/Widgets/ProgressBar.hs view
@@ -52,6 +52,7 @@ w { growHorizontal_ = const $ return True , render_ = \this size ctx -> renderProgressBar size ctx =<< getState this+ , getCursorPosition_ = const $ return Nothing } setProgress wRef 0
vty-ui.cabal view
@@ -1,5 +1,5 @@ Name: vty-ui-Version: 1.6+Version: 1.6.1 Synopsis: An interactive terminal user interface library for Vty @@ -18,8 +18,8 @@ to see some of the things the library can do! Category: User Interfaces-Author: Jonathan Daugherty <jtd@galois.com>-Maintainer: Jonathan Daugherty <jtd@galois.com>+Author: Jonathan Daugherty <cygnus@foobox.com>+Maintainer: Jonathan Daugherty <cygnus@foobox.com> Build-Type: Simple License: BSD3 License-File: LICENSE@@ -136,7 +136,7 @@ Executable vty-ui-tests Build-Depends: base >= 4 && < 5,- QuickCheck >= 2.4 && < 2.6,+ QuickCheck >= 2.4 && < 2.7, random >= 1.0, text, vty,