Skip to content

Commit

Permalink
On windows show 'Y' in checkbox, instead of 'I'
Browse files Browse the repository at this point in the history
  • Loading branch information
dfordivam committed Nov 14, 2024
1 parent a32a559 commit 71f5738
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib-tui/GHCup/Brick/Common.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module GHCup.Brick.Common (
installedSign,
setSign,
notInstalledSign,
checkBoxSelectedSign,
showKey,
showMod,
keyToWidget,
Expand Down Expand Up @@ -179,6 +180,13 @@ notInstalledSign = "X "
notInstalledSign = ""
#endif

checkBoxSelectedSign :: String
#if IS_WINDOWS
checkBoxSelectedSign = "Y "
#else
checkBoxSelectedSign = ""
#endif


showKey :: Vty.Key -> String
showKey (Vty.KChar c) = [c]
Expand Down
2 changes: 1 addition & 1 deletion lib-tui/GHCup/Brick/Widgets/Menu.hs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ createCheckBoxInput = FieldInput False Right "" checkBoxRender checkBoxHandler
border w = Brick.txt "[" <+> (Brick.padRight (Brick.Pad 1) $ Brick.padLeft (Brick.Pad 2) w) <+> Brick.txt "]"
drawBool b =
if b
then border . Brick.withAttr Attributes.installedAttr $ Brick.str Common.installedSign
then border . Brick.withAttr Attributes.installedAttr $ Brick.str Common.checkBoxSelectedSign
else border . Brick.withAttr Attributes.notInstalledAttr $ Brick.str Common.notInstalledSign
checkBoxRender focus _ help _ check f = (, Nothing) $
let core = f $ drawBool check
Expand Down

0 comments on commit 71f5738

Please sign in to comment.