Skip to content

Commit

Permalink
Add simple way to view keyboard shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
hojberg committed Jan 7, 2025
1 parent 6e6386b commit 08ef7e8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/UI/KeyboardShortcut.elm
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,28 @@ view model shortcut =
viewBase content


viewSimple : OperatingSystem -> KeyboardShortcut -> Html msg
viewSimple os shortcut =
let
content =
case shortcut of
Sequence Nothing key ->
[ viewKey os key False ]

Sequence (Just keyA) keyB ->
[ viewKey os keyA False
, viewThen
, viewKey os keyB False
]

Chord mod key ->
[ viewKey os mod False
, viewKey os key False
]
in
viewBase content


viewShortcuts : Model -> List KeyboardShortcut -> Html msg
viewShortcuts model shortcuts =
let
Expand Down

0 comments on commit 08ef7e8

Please sign in to comment.