Skip to content

Commit

Permalink
Frontend.Maui: Color.Default equivalent for maui
Browse files Browse the repository at this point in the history
Save previous assigned color and use instead of Color.Default.
This is needed because maui doesn't have Color.Default [1]. And
this commit is workaround for that.

[1] dotnet/Microsoft.Maui.Graphics#57
  • Loading branch information
parhamsaremi committed May 25, 2023
1 parent 14d3351 commit c9ad130
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/GWallet.Frontend.XF/SendPage.xaml.fs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ type SendPage(account: IAccount, receivePage: Page, newReceivePageFunc: unit->Pa
let transactionLayout = mainLayout.FindByName<StackLayout> "transactionLayout"
let transactionLabel = mainLayout.FindByName<Label> "transactionLabel"
let transactionEntry = mainLayout.FindByName<Entry> "transactionEntry"
#if !XAMARIN
let defaultTransactionEntryTextColor = transactionEntry.TextColor
#endif
let amountToSendEntry = mainLayout.FindByName<Entry> "amountToSend"
#if !XAMARIN
let defaultAmountToSendTextColor = amountToSendEntry.TextColor
#endif
let destinationAddressEntry = mainLayout.FindByName<Entry> "destinationAddressEntry"
let allBalanceButton = mainLayout.FindByName<Button> "allBalance"
let passwordEntry = mainLayout.FindByName<Entry> "passwordEntry"
Expand Down Expand Up @@ -457,6 +463,8 @@ type SendPage(account: IAccount, receivePage: Page, newReceivePageFunc: unit->Pa
MainThread.BeginInvokeOnMainThread(fun _ ->
#if XAMARIN
transactionEntry.TextColor <- Color.Default
#else
transactionEntry.TextColor <- defaultTransactionEntryTextColor
#endif
destinationAddressEntry.Text <- unsignedTransaction.Proposal.DestinationAddress
amountToSendEntry.Text <- unsignedTransaction.Proposal.Amount.ValueToSend.ToString()
Expand Down Expand Up @@ -484,6 +492,8 @@ type SendPage(account: IAccount, receivePage: Page, newReceivePageFunc: unit->Pa
MainThread.BeginInvokeOnMainThread(fun _ ->
#if XAMARIN
transactionEntry.TextColor <- Color.Default
#else
transactionEntry.TextColor <- defaultTransactionEntryTextColor
#endif
sendOrSignButton.IsEnabled <- true
)
Expand Down Expand Up @@ -538,6 +548,10 @@ type SendPage(account: IAccount, receivePage: Page, newReceivePageFunc: unit->Pa
MainThread.BeginInvokeOnMainThread(fun _ ->
amountToSend.TextColor <- Color.Default
)
#else
MainThread.BeginInvokeOnMainThread(fun _ ->
amountToSend.TextColor <- defaultAmountToSendTextColor
)
#endif
match usdRate with
| NotFresh NotAvailable ->
Expand Down

0 comments on commit c9ad130

Please sign in to comment.