diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2017-02-25 21:33:30 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2017-02-25 21:33:43 -0700 |
commit | 6d0181002b841fee90d03dae0aa4759fdfcc46b5 (patch) | |
tree | 7423fb6be6d525ff909ca4008e9cb8f0af2a5e54 | |
parent | 0f443804011224eace10058d8c1672d3623a3b8f (diff) | |
download | sscan-6d0181002b841fee90d03dae0aa4759fdfcc46b5.tar.gz |
list of actions
-rw-r--r-- | Main.hs | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -19,6 +19,7 @@ import Brick.Widgets.Core import Data.Text.Markup ((@@)) import Brick.Widgets.DefnList +import Data.Maybe (isJust) import Presets import Types.Preset import Types.State @@ -47,7 +48,23 @@ drawUI st = [ui] presetsBox = defnList AlignLeft (Just $ V.withStyle V.currentAttr V.bold) (map (\(Preset k desc _) -> ([k], desc)) presets) - actionsBox = str "actions" + actionsBox = defnList AlignLeft + (Just $ V.withStyle V.currentAttr V.bold) $ + (if st^.stOutFormat == PDF + then (if isJust $ st^.stScanningSession + then [ ("SPC", "scan next page") + , ("RET", "scan final page") + , ("q", "declare last page was final page") + ] + else [ ("SPC", "scan first page of multi-page document") + , ("RET", "scan single page document") + , ("q", "quit sscan") + ] + ) + else [ ("SPC", "scan page") + , ("q", "quit sscan") + ] + ) handleHotKey :: St -> Char -> EventM () (Next St) handleHotKey st 'q' = halt st |