Skip to content

Commit

Permalink
feat: ui: Add a dark theme
Browse files Browse the repository at this point in the history
I wanted a theme with roughly the same degree of colour as the
default but which was easier on my eyes late at night.

Signed-off-by: Jonathan Dowland <[email protected]>
  • Loading branch information
jmtd authored and simonmichael committed Feb 19, 2024
1 parent 4c15cfb commit 32328e3
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
23 changes: 23 additions & 0 deletions hledger-ui/Hledger/UI/Theme.hs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,29 @@ themesList = [
(attrName "list" <> attrName "selected" , defAttr & reverseVideo)
])

,("dark", attrMap (white `on` black & dim) [
(attrName "border" , white `on` black)
, (attrName "border" <> attrName "bold" , currentAttr & bold)
, (attrName "border" <> attrName "depth" , active)
, (attrName "border" <> attrName "filename" , currentAttr)
, (attrName "border" <> attrName "key" , active)
, (attrName "border" <> attrName "minibuffer" , white `on` black & bold)
, (attrName "border" <> attrName "query" , active)
, (attrName "border" <> attrName "selected" , active)
, (attrName "error" , fg red)
, (attrName "help" , currentAttr & bold)
, (attrName "help" <> attrName "heading" , fg blue)
, (attrName "help" <> attrName "key" , active)
, (attrName "list" <> attrName "amount" <> attrName "decrease" , fg red)
, (attrName "list" <> attrName "amount" <> attrName "decrease" <> attrName "selected" , red `on` black & bold)
, (attrName "list" <> attrName "balance" , currentAttr)
, (attrName "list" <> attrName "balance" <> attrName "negative" , fg red)
, (attrName "list" <> attrName "balance" <> attrName "positive" , fg white)
, (attrName "list" <> attrName "balance" <> attrName "negative" <> attrName "selected" , red `on` black & bold)
, (attrName "list" <> attrName "balance" <> attrName "positive" <> attrName "selected" , yellow `on` black & bold)
, (attrName "list" <> attrName "selected" , yellow `on` black & bold)
])

]

-- halfbrightattr = defAttr & dim
Expand Down
2 changes: 1 addition & 1 deletion hledger-ui/hledger-ui.1
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ hledger\-ui provides the following options:
\f[CR]\-w \-\-watch\f[R]
watch for data and date changes and reload automatically
.TP
\f[CR]\-\-theme=default|terminal|greenterm\f[R]
\f[CR]\-\-theme=default|terminal|greenterm|dark\f[R]
use this custom display theme
.TP
\f[CR]\-\-menu\f[R]
Expand Down
2 changes: 1 addition & 1 deletion hledger-ui/hledger-ui.info
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ the data.
'-w --watch'

watch for data and date changes and reload automatically
'--theme=default|terminal|greenterm'
'--theme=default|terminal|greenterm|dark'

use this custom display theme
'--menu'
Expand Down
2 changes: 1 addition & 1 deletion hledger-ui/hledger-ui.m4.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ hledger-ui provides the following options:
`-w --watch`
: watch for data and date changes and reload automatically

`--theme=default|terminal|greenterm`
`--theme=default|terminal|greenterm|dark`
: use this custom display theme

`--menu`
Expand Down
2 changes: 1 addition & 1 deletion hledger-ui/hledger-ui.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ OPTIONS
-w --watch
watch for data and date changes and reload automatically

--theme=default|terminal|greenterm
--theme=default|terminal|greenterm|dark
use this custom display theme

--menu start in the menu screen
Expand Down

0 comments on commit 32328e3

Please sign in to comment.