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 Data.Time.Calendar (Day)
import qualified Data.Vector as V
import Graphics.Vty (Event(..),Key(..))
import Graphics.Vty (Event(..),Key(..),Modifier(..))
import Lens.Micro.Platform
import System.Console.ANSI
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 c) [] | c `elem` ['+','='] -> continue $ regenerateScreens j d $ incDepth ui
EvKey (KChar 't') [] -> continue $ regenerateScreens j d $ setReportPeriod (DayPeriod d) ui
EvKey (KChar 'd') [] -> continue $ regenerateScreens j d $ cycleReportDurationDown d ui
EvKey (KChar 'u') [] -> continue $ regenerateScreens j d $ cycleReportDurationUp d ui
EvKey (KChar 't') [] -> continue $ regenerateScreens j d $ setReportPeriod (DayPeriod d) ui
EvKey (KDown) [MShift] -> continue $ regenerateScreens j d $ cycleReportDurationDown d 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 'Z') [] -> scrollTop >> (continue $ regenerateScreens j d $ toggleEmpty 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 Data.Time.Calendar (Day)
import qualified Data.Vector as V
import Graphics.Vty (Event(..),Key(..))
import Graphics.Vty (Event(..),Key(..),Modifier(..))
import Brick
import Brick.Widgets.List
import Brick.Widgets.Edit
@ -259,11 +259,15 @@ rsHandle ui@UIState{
EvKey (KChar 'g') [] -> liftIO (uiReloadJournalIfChanged copts d j ui) >>= continue
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 't') [] -> continue $ regenerateScreens j d $ setReportPeriod (DayPeriod d) ui
EvKey (KChar 'd') [] -> continue $ regenerateScreens j d $ cycleReportDurationDown d ui
EvKey (KChar 'u') [] -> continue $ regenerateScreens j d $ cycleReportDurationUp d ui
EvKey (KChar 't') [] -> continue $ regenerateScreens j d $ setReportPeriod (DayPeriod d) ui
EvKey (KDown) [MShift] -> continue $ regenerateScreens j d $ cycleReportDurationDown d 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
where
(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
filter or \f[C]ESCAPE\f[]to cancel.
.PP
\f[C]t\f[] sets the report period to today, while \f[C]d\f[] and
\f[C]u\f[] cycle downward and upward through standard report periods \-
day, week, month, quarter, year, and unlimited.
This is useful on the register screen, to limit the transaction history.
When a standard report period is selected in this way, \f[C]n\f[] and
\f[C]p\f[] step to the next or previous period.
(For non\-standard periods, you can use \f[C]/\f[] to set a
\f[C]date:\f[] query.)
\f[C]d\f[] and \f[C]u\f[] cycle downward and upward through standard
report periods \- year, quarter, month, week, day.
When a standard report period is selected, \f[C]n\f[] and \f[C]p\f[]
step it to the next or previous period.
\f[C]Shift\-down/up/right/left\f[] can also be used for this.
\f[C]t\f[] sets the report period to today.
For non\-standard periods, you can use \f[C]/\f[] to set a
\f[C]date:\f[] query.
.PP
\f[C]BACKSPACE\f[] or \f[C]DELETE\f[] clears any filters in effect.
.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
set the new filter or `ESCAPE'to cancel.
`t' sets the report period to today, while `d' and `u' cycle
downward and upward through standard report periods - day, week, month,
quarter, year, and unlimited. This is useful on the register screen, to
limit the transaction history. When a standard report period is
selected in this way, `n' and `p' step to the next or previous period.
(For non-standard periods, you can use `/' to set a `date:' query.)
`d' and `u' cycle downward and upward through standard report
periods - year, quarter, month, week, day. When a standard report period
is selected, `n' and `p' step it to the next or previous period.
`Shift-down/up/right/left' can also be used for this. `t' sets the
report period to today. For non-standard periods, you can use `/' to
set a `date:' query.
`BACKSPACE' or `DELETE' clears any filters in effect.
@ -347,15 +347,15 @@ Node: OPTIONS831
Ref: #options930
Node: KEYS3743
Ref: #keys3840
Node: SCREENS6157
Ref: #screens6244
Node: Accounts screen6334
Ref: #accounts-screen6464
Node: Register screen7930
Ref: #register-screen8087
Node: Transaction screen10047
Ref: #transaction-screen10207
Node: Error screen11074
Ref: #error-screen11198
Node: SCREENS6107
Ref: #screens6194
Node: Accounts screen6284
Ref: #accounts-screen6414
Node: Register screen7880
Ref: #register-screen8037
Node: Transaction screen9997
Ref: #transaction-screen10157
Node: Error screen11024
Ref: #error-screen11148

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)),
and `ENTER`to set the new filter or `ESCAPE`to cancel.
`t` sets the report period to today,
while `d` and `u` cycle downward and upward through standard report periods
- day, week, month, quarter, year, and unlimited.
This is useful on the register screen, to limit the transaction history.
When a standard report period is selected in this way,
`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).)
`d` and `u` cycle downward and upward through standard report periods - year, quarter, month, week, day.
When a standard report period is selected, `n` and `p` step it to the next or previous period.
`Shift-down/up/right/left` can also be used for this.
`t` sets the report period to today.
For non-standard periods, you can use `/` to set a [`date:` query](manual.html#queries).
`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
the new filter or ESCAPEto cancel.
t sets the report period to today, while d and u cycle downward and
upward through standard report periods - day, week, month, quarter,
year, and unlimited. This is useful on the register screen, to limit
the transaction history. When a standard report period is selected in
this way, n and p step to the next or previous period. (For non-stan-
dard periods, you can use / to set a date: query.)
d and u cycle downward and upward through standard report periods -
year, quarter, month, week, day. When a standard report period is
selected, n and p step it to the next or previous period.
Shift-down/up/right/left can also be used for this. t sets the report
period to today. For non-standard periods, you can use / to set a
date: query.
BACKSPACE or DELETE clears any filters in effect.