ui: shift-left/right/up/down equivalent to p/n/u/d

This commit is contained in:
Simon Michael 2016-08-09 16:28:53 -07:00
parent 85fb43a756
commit fe1408485d
6 changed files with 55 additions and 49 deletions

View File

@ -22,7 +22,7 @@ import Data.Monoid
import qualified Data.Text as T import qualified Data.Text as T
import Data.Time.Calendar (Day) import Data.Time.Calendar (Day)
import qualified Data.Vector as V import qualified Data.Vector as V
import Graphics.Vty (Event(..),Key(..)) import Graphics.Vty (Event(..),Key(..),Modifier(..))
import Lens.Micro.Platform import Lens.Micro.Platform
import System.Console.ANSI import System.Console.ANSI
import System.FilePath (takeFileName) import System.FilePath (takeFileName)
@ -286,11 +286,15 @@ asHandle ui0@UIState{
EvKey (KChar '-') [] -> continue $ regenerateScreens j d $ decDepth ui EvKey (KChar '-') [] -> continue $ regenerateScreens j d $ decDepth ui
EvKey (KChar '_') [] -> continue $ regenerateScreens j d $ decDepth ui EvKey (KChar '_') [] -> continue $ regenerateScreens j d $ decDepth ui
EvKey (KChar c) [] | c `elem` ['+','='] -> continue $ regenerateScreens j d $ incDepth ui EvKey (KChar c) [] | c `elem` ['+','='] -> continue $ regenerateScreens j d $ incDepth ui
EvKey (KChar 'd') [] -> continue $ regenerateScreens j d $ cycleReportDurationDown d ui EvKey (KChar 't') [] -> continue $ regenerateScreens j d $ setReportPeriod (DayPeriod d) ui
EvKey (KChar 'u') [] -> continue $ regenerateScreens j d $ cycleReportDurationUp d ui EvKey (KChar 'd') [] -> continue $ regenerateScreens j d $ cycleReportDurationDown d ui
EvKey (KChar 't') [] -> continue $ regenerateScreens j d $ setReportPeriod (DayPeriod d) ui EvKey (KChar 'u') [] -> continue $ regenerateScreens j d $ cycleReportDurationUp d ui
EvKey (KChar 'n') [] -> continue $ regenerateScreens j d $ nextReportPeriod ui EvKey (KDown) [MShift] -> continue $ regenerateScreens j d $ cycleReportDurationDown d ui
EvKey (KChar 'p') [] -> continue $ regenerateScreens j d $ previousReportPeriod ui EvKey (KUp) [MShift] -> continue $ regenerateScreens j d $ cycleReportDurationUp d ui
EvKey (KChar 'n') [] -> continue $ regenerateScreens j d $ nextReportPeriod ui
EvKey (KChar 'p') [] -> continue $ regenerateScreens j d $ previousReportPeriod ui
EvKey (KRight) [MShift] -> continue $ regenerateScreens j d $ nextReportPeriod ui
EvKey (KLeft) [MShift] -> continue $ regenerateScreens j d $ previousReportPeriod ui
EvKey (KChar 'F') [] -> continue $ regenerateScreens j d $ toggleFlat ui EvKey (KChar 'F') [] -> continue $ regenerateScreens j d $ toggleFlat ui
EvKey (KChar 'Z') [] -> scrollTop >> (continue $ regenerateScreens j d $ toggleEmpty ui) EvKey (KChar 'Z') [] -> scrollTop >> (continue $ regenerateScreens j d $ toggleEmpty ui)
EvKey (KChar 'C') [] -> scrollTop >> (continue $ regenerateScreens j d $ toggleCleared ui) EvKey (KChar 'C') [] -> scrollTop >> (continue $ regenerateScreens j d $ toggleCleared ui)

View File

@ -18,7 +18,7 @@ import Data.Maybe
import qualified Data.Text as T import qualified Data.Text as T
import Data.Time.Calendar (Day) import Data.Time.Calendar (Day)
import qualified Data.Vector as V import qualified Data.Vector as V
import Graphics.Vty (Event(..),Key(..)) import Graphics.Vty (Event(..),Key(..),Modifier(..))
import Brick import Brick
import Brick.Widgets.List import Brick.Widgets.List
import Brick.Widgets.Edit import Brick.Widgets.Edit
@ -259,11 +259,15 @@ rsHandle ui@UIState{
EvKey (KChar 'g') [] -> liftIO (uiReloadJournalIfChanged copts d j ui) >>= continue EvKey (KChar 'g') [] -> liftIO (uiReloadJournalIfChanged copts d j ui) >>= continue
EvKey (KChar 'I') [] -> continue $ uiCheckBalanceAssertions d (toggleIgnoreBalanceAssertions ui) EvKey (KChar 'I') [] -> continue $ uiCheckBalanceAssertions d (toggleIgnoreBalanceAssertions ui)
EvKey (KChar 'a') [] -> suspendAndResume $ clearScreen >> setCursorPosition 0 0 >> add copts j >> uiReloadJournalIfChanged copts d j ui EvKey (KChar 'a') [] -> suspendAndResume $ clearScreen >> setCursorPosition 0 0 >> add copts j >> uiReloadJournalIfChanged copts d j ui
EvKey (KChar 'd') [] -> continue $ regenerateScreens j d $ cycleReportDurationDown d ui EvKey (KChar 't') [] -> continue $ regenerateScreens j d $ setReportPeriod (DayPeriod d) ui
EvKey (KChar 'u') [] -> continue $ regenerateScreens j d $ cycleReportDurationUp d ui EvKey (KChar 'd') [] -> continue $ regenerateScreens j d $ cycleReportDurationDown d ui
EvKey (KChar 't') [] -> continue $ regenerateScreens j d $ setReportPeriod (DayPeriod d) ui EvKey (KChar 'u') [] -> continue $ regenerateScreens j d $ cycleReportDurationUp d ui
EvKey (KChar 'n') [] -> continue $ regenerateScreens j d $ nextReportPeriod ui EvKey (KDown) [MShift] -> continue $ regenerateScreens j d $ cycleReportDurationDown d ui
EvKey (KChar 'p') [] -> continue $ regenerateScreens j d $ previousReportPeriod ui EvKey (KUp) [MShift] -> continue $ regenerateScreens j d $ cycleReportDurationUp d ui
EvKey (KChar 'n') [] -> continue $ regenerateScreens j d $ nextReportPeriod ui
EvKey (KChar 'p') [] -> continue $ regenerateScreens j d $ previousReportPeriod ui
EvKey (KRight) [MShift] -> continue $ regenerateScreens j d $ nextReportPeriod ui
EvKey (KLeft) [MShift] -> continue $ regenerateScreens j d $ previousReportPeriod ui
EvKey (KChar 'E') [] -> suspendAndResume $ void (runEditor pos f) >> uiReloadJournalIfChanged copts d j ui EvKey (KChar 'E') [] -> suspendAndResume $ void (runEditor pos f) >> uiReloadJournalIfChanged copts d j ui
where where
(pos,f) = case listSelectedElement rsList of (pos,f) = case listSelectedElement rsList of

View File

@ -234,14 +234,14 @@ While editing the query you can use typical command\-line edit keys
(CTRL\-a/e/d/k, cursor keys etc.), and \f[C]ENTER\f[]to set the new (CTRL\-a/e/d/k, cursor keys etc.), and \f[C]ENTER\f[]to set the new
filter or \f[C]ESCAPE\f[]to cancel. filter or \f[C]ESCAPE\f[]to cancel.
.PP .PP
\f[C]t\f[] sets the report period to today, while \f[C]d\f[] and \f[C]d\f[] and \f[C]u\f[] cycle downward and upward through standard
\f[C]u\f[] cycle downward and upward through standard report periods \- report periods \- year, quarter, month, week, day.
day, week, month, quarter, year, and unlimited. When a standard report period is selected, \f[C]n\f[] and \f[C]p\f[]
This is useful on the register screen, to limit the transaction history. step it to the next or previous period.
When a standard report period is selected in this way, \f[C]n\f[] and \f[C]Shift\-down/up/right/left\f[] can also be used for this.
\f[C]p\f[] step to the next or previous period. \f[C]t\f[] sets the report period to today.
(For non\-standard periods, you can use \f[C]/\f[] to set a For non\-standard periods, you can use \f[C]/\f[] to set a
\f[C]date:\f[] query.) \f[C]date:\f[] query.
.PP .PP
\f[C]BACKSPACE\f[] or \f[C]DELETE\f[] clears any filters in effect. \f[C]BACKSPACE\f[] or \f[C]DELETE\f[] clears any filters in effect.
.PP .PP

View File

@ -166,12 +166,12 @@ described below). While editing the query you can use typical
command-line edit keys (CTRL-a/e/d/k, cursor keys etc.), and `ENTER'to command-line edit keys (CTRL-a/e/d/k, cursor keys etc.), and `ENTER'to
set the new filter or `ESCAPE'to cancel. set the new filter or `ESCAPE'to cancel.
`t' sets the report period to today, while `d' and `u' cycle `d' and `u' cycle downward and upward through standard report
downward and upward through standard report periods - day, week, month, periods - year, quarter, month, week, day. When a standard report period
quarter, year, and unlimited. This is useful on the register screen, to is selected, `n' and `p' step it to the next or previous period.
limit the transaction history. When a standard report period is `Shift-down/up/right/left' can also be used for this. `t' sets the
selected in this way, `n' and `p' step to the next or previous period. report period to today. For non-standard periods, you can use `/' to
(For non-standard periods, you can use `/' to set a `date:' query.) set a `date:' query.
`BACKSPACE' or `DELETE' clears any filters in effect. `BACKSPACE' or `DELETE' clears any filters in effect.
@ -347,15 +347,15 @@ Node: OPTIONS831
Ref: #options930 Ref: #options930
Node: KEYS3743 Node: KEYS3743
Ref: #keys3840 Ref: #keys3840
Node: SCREENS6157 Node: SCREENS6107
Ref: #screens6244 Ref: #screens6194
Node: Accounts screen6334 Node: Accounts screen6284
Ref: #accounts-screen6464 Ref: #accounts-screen6414
Node: Register screen7930 Node: Register screen7880
Ref: #register-screen8087 Ref: #register-screen8037
Node: Transaction screen10047 Node: Transaction screen9997
Ref: #transaction-screen10207 Ref: #transaction-screen10157
Node: Error screen11074 Node: Error screen11024
Ref: #error-screen11198 Ref: #error-screen11148
 
End Tag Table End Tag Table

View File

@ -93,13 +93,11 @@ command-line edit keys
([CTRL-a/e/d/k, cursor keys etc.](http://hackage.haskell.org/package/brick-0.7/docs/Brick-Widgets-Edit.html#t:Editor)), ([CTRL-a/e/d/k, cursor keys etc.](http://hackage.haskell.org/package/brick-0.7/docs/Brick-Widgets-Edit.html#t:Editor)),
and `ENTER`to set the new filter or `ESCAPE`to cancel. and `ENTER`to set the new filter or `ESCAPE`to cancel.
`t` sets the report period to today, `d` and `u` cycle downward and upward through standard report periods - year, quarter, month, week, day.
while `d` and `u` cycle downward and upward through standard report periods When a standard report period is selected, `n` and `p` step it to the next or previous period.
- day, week, month, quarter, year, and unlimited. `Shift-down/up/right/left` can also be used for this.
This is useful on the register screen, to limit the transaction history. `t` sets the report period to today.
When a standard report period is selected in this way, For non-standard periods, you can use `/` to set a [`date:` query](manual.html#queries).
`n` and `p` step to the next or previous period.
(For non-standard periods, you can use `/` to set a [`date:` query](manual.html#queries).)
`BACKSPACE` or `DELETE` clears any filters in effect. `BACKSPACE` or `DELETE` clears any filters in effect.

View File

@ -155,12 +155,12 @@ KEYS
mand-line edit keys (CTRL-a/e/d/k, cursor keys etc.), and ENTERto set mand-line edit keys (CTRL-a/e/d/k, cursor keys etc.), and ENTERto set
the new filter or ESCAPEto cancel. the new filter or ESCAPEto cancel.
t sets the report period to today, while d and u cycle downward and d and u cycle downward and upward through standard report periods -
upward through standard report periods - day, week, month, quarter, year, quarter, month, week, day. When a standard report period is
year, and unlimited. This is useful on the register screen, to limit selected, n and p step it to the next or previous period.
the transaction history. When a standard report period is selected in Shift-down/up/right/left can also be used for this. t sets the report
this way, n and p step to the next or previous period. (For non-stan- period to today. For non-standard periods, you can use / to set a
dard periods, you can use / to set a date: query.) date: query.
BACKSPACE or DELETE clears any filters in effect. BACKSPACE or DELETE clears any filters in effect.