mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-21 09:58:26 +00:00
Allow to enable/disable keyboard navigation in user settings
This commit is contained in:
@ -39,6 +39,7 @@ type alias Model =
|
||||
, searchMenuTagCatCount : Maybe Int
|
||||
, searchMenuTagCatCountModel : Comp.IntField.Model
|
||||
, formFields : List Field
|
||||
, itemDetailShortcuts : Bool
|
||||
}
|
||||
|
||||
|
||||
@ -87,6 +88,7 @@ init flags settings =
|
||||
False
|
||||
"Number of categories in search menu"
|
||||
, formFields = settings.formFields
|
||||
, itemDetailShortcuts = settings.itemDetailShortcuts
|
||||
}
|
||||
, Api.getTags flags "" GetTagsResp
|
||||
)
|
||||
@ -103,6 +105,7 @@ type Msg
|
||||
| SearchMenuTagMsg Comp.IntField.Msg
|
||||
| SearchMenuTagCatMsg Comp.IntField.Msg
|
||||
| FieldListMsg Comp.FieldListSelect.Msg
|
||||
| ToggleItemDetailShortcuts
|
||||
|
||||
|
||||
|
||||
@ -261,6 +264,15 @@ update sett msg model =
|
||||
Nothing
|
||||
)
|
||||
|
||||
ToggleItemDetailShortcuts ->
|
||||
let
|
||||
flag =
|
||||
not model.itemDetailShortcuts
|
||||
in
|
||||
( { model | itemDetailShortcuts = flag }
|
||||
, Just { sett | itemDetailShortcuts = flag }
|
||||
)
|
||||
|
||||
|
||||
|
||||
--- View
|
||||
@ -342,6 +354,19 @@ view flags _ model =
|
||||
]
|
||||
]
|
||||
]
|
||||
, div [ class "field" ]
|
||||
[ div [ class "ui checkbox" ]
|
||||
[ input
|
||||
[ type_ "checkbox"
|
||||
, onCheck (\_ -> ToggleItemDetailShortcuts)
|
||||
, checked model.itemDetailShortcuts
|
||||
]
|
||||
[]
|
||||
, label []
|
||||
[ text "Use keyboard shortcuts for navigation and confirm/unconfirm with open edit menu."
|
||||
]
|
||||
]
|
||||
]
|
||||
, div [ class "grouped fields" ]
|
||||
[ label [] [ text "Position of item notes" ]
|
||||
, div [ class "field" ]
|
||||
|
Reference in New Issue
Block a user