switch from ncurses to brick #1
|
@ -22,11 +22,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
module Mtlstats (app) where
|
module Mtlstats (app) where
|
||||||
|
|
||||||
import Brick.AttrMap (AttrMap, forceAttrMap)
|
import Brick.AttrMap (AttrMap, forceAttrMap)
|
||||||
import Brick.Main (App (..), showFirstCursor)
|
import Brick.Main (App (..), halt, showFirstCursor)
|
||||||
import Brick.Types (Widget)
|
import Brick.Types (BrickEvent (VtyEvent), Widget)
|
||||||
import Brick.Util (on)
|
import Brick.Util (on)
|
||||||
import Brick.Widgets.Core (fill)
|
import Brick.Widgets.Core (fill)
|
||||||
import Graphics.Vty.Attributes.Color (blue, white)
|
import Graphics.Vty.Attributes.Color (blue, white)
|
||||||
|
import Graphics.Vty.Input.Events
|
||||||
|
( Event (EvKey)
|
||||||
|
, Modifier (MCtrl)
|
||||||
|
, Key (KChar)
|
||||||
|
)
|
||||||
import Lens.Micro (to)
|
import Lens.Micro (to)
|
||||||
import Lens.Micro.Mtl (use)
|
import Lens.Micro.Mtl (use)
|
||||||
|
|
||||||
|
@ -50,6 +55,7 @@ draw s =
|
||||||
]
|
]
|
||||||
|
|
||||||
handler :: Handler ()
|
handler :: Handler ()
|
||||||
|
handler (VtyEvent (EvKey (KChar 'c') [MCtrl])) = halt
|
||||||
handler e = do
|
handler e = do
|
||||||
c <- use (to dispatch)
|
c <- use (to dispatch)
|
||||||
handleController c e
|
handleController c e
|
||||||
|
|
Loading…
Reference in New Issue
Block a user