diff --git a/src/Zenith/CLI.hs b/src/Zenith/CLI.hs index ff8b6a7..204dd90 100644 --- a/src/Zenith/CLI.hs +++ b/src/Zenith/CLI.hs @@ -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 = diff --git a/src/Zenith/GUI.hs b/src/Zenith/GUI.hs index 304d960..fa991bf 100644 --- a/src/Zenith/GUI.hs +++ b/src/Zenith/GUI.hs @@ -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