Skip to content

Commit

Permalink
Show label fully when field is focused (settings window)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvee1 committed Dec 21, 2023
1 parent 0b877aa commit 5432772
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ description: Hascard is a text-based user interface for reviewing notes

dependencies:
- base >= 4.7 && < 5
- brick >= 2.1.1 && < 3.0
- brick >= 2.3.1 && < 3.0
- containers > 0.6.0 && < 0.8
- directory >= 1.3.3 && < 1.4
- filepath >= 1.4.2 && < 1.5
Expand Down
6 changes: 4 additions & 2 deletions src/Parameters.hs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ chunkSubsetField capacity stLens initialState =
, formFieldLens = stLens
, formFieldUpdate = const
, formFieldRenderHelper = id
, formFieldConcat = customConcat }
, formFieldConcat = customConcat
, formFieldVisibilityMode = ShowAugmentedField }

okField :: (Ord n, Show n) => Lens' s Bool -> n -> String -> s -> FormFieldState s e n
okField stLens name label initialState =
Expand All @@ -153,7 +154,8 @@ okField stLens name label initialState =
, formFieldLens = stLens
, formFieldUpdate = const
, formFieldRenderHelper = id
, formFieldConcat = vBox }
, formFieldConcat = vBox
, formFieldVisibilityMode = ShowAugmentedField }

renderOk :: String -> n -> Bool -> Bool -> Widget n
renderOk label _ focus _ =
Expand Down
6 changes: 4 additions & 2 deletions src/UI/BrickHelpers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ yesnoField rightAlign stLens name label initialState =
, formFieldLens = stLens
, formFieldUpdate = const
, formFieldRenderHelper = id
, formFieldConcat = vBox }
, formFieldConcat = vBox
, formFieldVisibilityMode = ShowFocusedFieldOnly }

renderYesno :: Ord n => Bool -> String -> n -> Bool -> Bool -> Widget n
renderYesno rightAlign label n foc val =
Expand Down Expand Up @@ -114,7 +115,8 @@ naturalNumberField bound stLens name postfix initialState =
, formFieldLens = stLens
, formFieldUpdate = const
, formFieldRenderHelper = id
, formFieldConcat = vBox }
, formFieldConcat = vBox
, formFieldVisibilityMode = ShowAugmentedField }

renderNaturalNumber :: Int -> String -> n -> Bool -> Int -> Widget n
renderNaturalNumber bound postfix n foc val =
Expand Down
1 change: 1 addition & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ packages:
#
extra-deps:
- vty-windows-0.2.0.1
- brick-2.3.1@sha256:4c36e5d77dc360641a5aa9361949d981e4aecc7f1372c862e0b2451d614b5f5c,17394
# - acme-missiles-0.3
# - git: https://github.com/commercialhaskell/stack.git
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
Expand Down
7 changes: 7 additions & 0 deletions stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ packages:
size: 2160
original:
hackage: vty-windows-0.2.0.1
- completed:
hackage: brick-2.3.1@sha256:4c36e5d77dc360641a5aa9361949d981e4aecc7f1372c862e0b2451d614b5f5c,17394
pantry-tree:
sha256: 7476f449a27ac6736264f1fdde37e0282d43cd803d00da5ebe0ff811ee4035fc
size: 4671
original:
hackage: brick-2.3.1@sha256:4c36e5d77dc360641a5aa9361949d981e4aecc7f1372c862e0b2451d614b5f5c,17394
snapshots:
- completed:
sha256: e176944bc843f740e05242fa7a66ca1f440c127e425254f7f1257f9b19add23f
Expand Down

0 comments on commit 5432772

Please sign in to comment.