rvv001 - Show Balance in FIAT - GUI version

First commit
This commit is contained in:
Rene V. Vergara A. 2024-12-15 19:41:06 -05:00
parent a290f9c912
commit 843821232d
2 changed files with 18 additions and 1 deletions

View file

@ -556,7 +556,6 @@ drawUI s = [splashDialog s, helpDialog s, displayDialog s, inputDialog s, ui s]
(capCommand "R" "efresh" <+> capCommand3 "E" "x" "it")
]
])
--
splashDialog :: State -> Widget Name
splashDialog st =

View file

@ -147,6 +147,8 @@ data AppEvent
| SendShield
| StartSync
| TreeSync
| ShowFIATBalance
| CloseFIATBalance
deriving (Eq, Show)
data AppModel = AppModel
@ -206,6 +208,7 @@ data AppModel = AppModel
, _tBalanceValid :: !Bool
, _sBalance :: !Integer
, _sBalanceValid :: !Bool
, _showFIATBalance :: !Bool
} deriving (Eq, Show)
makeLenses ''AppModel
@ -249,6 +252,7 @@ buildUI wenv model = widgetTree
, modalOverlay `nodeVisible` isJust (model ^. modalMsg)
, adrbookOverlay `nodeVisible` model ^. showAdrBook
, newAdrBkOverlay `nodeVisible` model ^. newAdrBkEntry
, sfBalOverlay `nodeVisible` model ^. showFIATBalance
, showABAddressOverlay (model ^. abdescrip) (model ^. abaddress) `nodeVisible`
model ^.
showABAddress
@ -326,6 +330,8 @@ buildUI wenv model = widgetTree
[bgColor white, borderB 1 gray, padding 3]
, box_ [alignLeft, onClick ShowDeShield] (label "De-Shield ZEC") `styleBasic`
[bgColor white, borderB 1 gray, padding 3]
, box_ [alignLeft, onClick ShowFIATBalance] (label "Balance in (") `styleBasic`
[bgColor white, borderB 1 gray, padding 3]
]) `styleBasic`
[bgColor btnColor, padding 3]
newBox =
@ -991,6 +997,13 @@ buildUI wenv model = widgetTree
, label_ (txtWrapN (fromMaybe "" (model ^. msgAB)) 64) [multiline]
, filler
]
sfBalOverlay =
alert CloseFIATBalance $
hstack
[ filler
, label "Account Balance in FIAT" `styleBasic` [textFont "Bold"]
, filler
]
shieldOverlay =
box
(vstack
@ -1505,6 +1518,10 @@ handleEvent wenv node model evt =
model & msgAB ?~ "Function not implemented..." & menuPopup .~ False
]
CloseMsgAB -> [Model $ model & msgAB .~ Nothing & inError .~ False]
--
ShowFIATBalance -> [Model $ model & showFIATBalance .~ True & menuPopup .~ False]
CloseFIATBalance -> [Model $ model & showFIATBalance .~ False]
--
ShowShield ->
if model ^. tBalance > 0
then [Model $ model & shieldZec .~ True & menuPopup .~ False]
@ -2019,6 +2036,7 @@ runZenithGUI config = do
False
shieldBal
False
False
startApp model handleEvent buildUI (params hD)
Left _e -> print "Zebra not available"
where