Skip to content

Commit

Permalink
split the view horizontally to enhace visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ffakenz committed Nov 22, 2024
1 parent c973799 commit 22b275d
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions hydra-tui/src/Hydra/TUI/Drawing.hs
Original file line number Diff line number Diff line change
Expand Up @@ -141,35 +141,40 @@ drawRemainingDepositDeadline deadline now =
then padLeftRight 1 $ vBox [txt "Remaining time to deposit: ", str (renderTime remaining)]
else txt "Deposit deadline passed, ready to recover."

drawPendingIncrement :: AddressInEra -> Maybe PendingIncrement -> UTCTime -> Widget Name
drawPendingIncrement ownAddress pendingIncrement now =
case pendingIncrement of
Nothing -> vBox []
Just PendingDeposit{utxoToCommit, deposit, depositDeadline} ->
vBox
[ drawUTxO (highlightOwnAddress ownAddress) utxoToCommit
, padTop (Pad 1) $ txt "Pending deposit: "
, txt $ show deposit
, txt "Pending deposit deadline: "
, drawRemainingDepositDeadline depositDeadline now
]
Just PendingIncrement{utxoToCommit} ->
vBox
[ drawUTxO (highlightOwnAddress ownAddress) utxoToCommit
, padTop (Pad 1) $ txt "NO Pending deposit"
]

drawFocusPanelOpen :: NetworkId -> VerificationKey PaymentKey -> UTxO -> UTxO -> Maybe PendingIncrement -> UTCTime -> OpenScreen -> Widget Name
drawFocusPanelOpen networkId vk utxo pendingUTxOToDecommit pendingIncrement now = \case
OpenHome ->
vBox
[ txt "Active UTxO: "
, drawUTxO (highlightOwnAddress ownAddress) utxo
[ vBox
[ txt "Active UTxO: "
, drawUTxO (highlightOwnAddress ownAddress) utxo
]
, hBorder
, hBox
[ vBox
[ txt "Pending UTxO to decommit: " <+> drawUTxO (highlightOwnAddress ownAddress) pendingUTxOToDecommit
]
, vBorder
, case pendingIncrement of
Nothing ->
vBox
[ txt "NO Pending UTxO to commit"
]
Just PendingDeposit{utxoToCommit, deposit, depositDeadline} ->
vBox
[ txt "Pending UTxO to commit: " <+> drawUTxO (highlightOwnAddress ownAddress) utxoToCommit
, txt $ "Pending deposit: " <> show deposit
, txt "Pending deposit deadline: " <+> drawRemainingDepositDeadline depositDeadline now
]
Just PendingIncrement{utxoToCommit} ->
vBox
[ txt "Pending UTxO to commit: " <+> drawUTxO (highlightOwnAddress ownAddress) utxoToCommit
, txt "NO Pending deposit: "
]
, vBox
[ txt "Pending UTxO to decommit: "
, drawUTxO (highlightOwnAddress ownAddress) pendingUTxOToDecommit
]
, hBorder
, txt "Pending UTxO to commit: "
, drawPendingIncrement ownAddress pendingIncrement now
]
SelectingUTxO x -> renderForm x
SelectingUTxOToDecommit x -> renderForm x
Expand Down

0 comments on commit 22b275d

Please sign in to comment.