From dee0a7e8e883e32db5a32457d0b3521469856759 Mon Sep 17 00:00:00 2001 From: "Rene Vergara A." Date: Thu, 5 Sep 2024 22:19:41 -0400 Subject: [PATCH] rvv041 - Address Book - New entry form working correctly - Show entry zec address on row click --- src/Zenith/GUI.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Zenith/GUI.hs b/src/Zenith/GUI.hs index 95b246d..c48e4d5 100644 --- a/src/Zenith/GUI.hs +++ b/src/Zenith/GUI.hs @@ -814,7 +814,7 @@ buildUI wenv model = widgetTree abookRow :: Int -> Entity AddressBook -> WidgetNode AppModel AppEvent abookRow idx ab = box_ - [onClick $ ShowTx idx, alignLeft] + [onClick $ ShowMessage (addressBookAbaddress $ entityVal ab), alignLeft] (hstack [ label @@ -865,7 +865,7 @@ buildUI wenv model = widgetTree , button "Cancel" CloseNewAdrBook `nodeEnabled` True ] ] - msgAdrBookOverlay= + msgAdrBookOverlay = alert CloseMsgAB $ hstack [ filler @@ -873,7 +873,7 @@ buildUI wenv model = widgetTree [textSize 32, textColor btnColor] `nodeVisible` (model ^. inError) , spacer - , label $ fromMaybe "" (model ^. msgAB) + , label_ (txtWrapN (fromMaybe "" (model ^. msgAB)) 64) [multiline] , filler ] @@ -1200,6 +1200,7 @@ handleEvent wenv node model evt = [Model $ model & newAdrBkEntry .~ False] SaveNewABEntry -> [ Task $ saveAddrBook (model ^. configuration) (ZcashNetDB (model ^. network)) (model ^. abdescrip) (model ^. abaddress) + , Model $ model & abdescrip .~ "" & abaddress .~ "" & newAdrBkEntry .~ False ] NotImplemented -> [Model $ model & msgAB ?~ "Function not implemented..." & menuPopup .~ False] CloseMsgAB -> [Model $ model & msgAB .~ Nothing & inError .~ False] @@ -1413,6 +1414,9 @@ timeTicker sendMsg = do threadDelay $ 1000 * 1000 timeTicker sendMsg +txtWrapN :: T.Text -> Int -> T.Text +txtWrapN t n = wrapText (WrapSettings False True NoFill FillAfterFirst) n t + txtWrap :: T.Text -> T.Text txtWrap = wrapText (WrapSettings False True NoFill FillAfterFirst) 32