Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateTotalWalletsBalance(l *load.Load) (dcrutil.Amount, dcrutil.Amount, error)
- func CoinImageBySymbol(l *load.Load, coinName string) *decredmaterial.Image
- func ContextDone(ctx context.Context) bool
- func CreateOrUpdateWalletDropDown(l *load.Load, dwn **decredmaterial.DropDown, wallets []*dcrlibwallet.Wallet, ...) *decredmaterial.DropDown
- func CreateOrderDropDown(l *load.Load, grp uint, pos uint) *decredmaterial.DropDown
- func DisableLog()
- func DurationAgo(timestamp int64) string
- func EndToEndRow(gtx layout.Context, leftWidget, rightWidget func(C) D) layout.Dimensions
- func FormatDateOrTime(timestamp int64) string
- func GoToURL(url string)
- func LayoutBalance(gtx layout.Context, l *load.Load, amount string) layout.Dimensions
- func LayoutBalanceColor(gtx layout.Context, l *load.Load, amount string, color color.NRGBA) layout.Dimensions
- func LayoutBalanceSize(gtx layout.Context, l *load.Load, amount string, mainTextSize unit.Value) layout.Dimensions
- func LayoutBalanceSizeScale(gtx layout.Context, l *load.Load, amount string, mainTextSize unit.Value, ...) layout.Dimensions
- func LayoutTransactionRow(gtx layout.Context, l *load.Load, row TransactionRow) layout.Dimensions
- func RetryFunc(retryAttempts int, sleepDur time.Duration, funcDesc string, ...) (int, error)
- func SecondsToDays(totalTimeLeft int64) string
- func StringNotEmpty(texts ...string) bool
- func SubpageHeaderButtons(l *load.Load) (decredmaterial.IconButton, decredmaterial.IconButton)
- func TimeAgo(timestamp int64) string
- func TimeFormat(secs int, long bool) string
- func TranslateErr(err error) string
- func TruncateString(str string, num int) string
- func TxConfirmations(l *load.Load, transaction dcrlibwallet.Transaction) int32
- func UniformHorizontalPadding(gtx layout.Context, body layout.Widget) layout.Dimensions
- func UniformPadding(gtx layout.Context, body layout.Widget) layout.Dimensions
- func UseLogger(logger slog.Logger)
- func WeekDayHourMinuteCalculator(timestamp int64) string
- type AccountSelector
- func (as *AccountSelector) AccountSelected(callback func(*dcrlibwallet.Account)) *AccountSelector
- func (as *AccountSelector) AccountValidator(accountIsValid func(*dcrlibwallet.Account) bool) *AccountSelector
- func (as *AccountSelector) Changed() bool
- func (as *AccountSelector) Handle()
- func (as *AccountSelector) Layout(gtx C) D
- func (as *AccountSelector) ListenForTxNotifications(ctx context.Context)
- func (as *AccountSelector) SelectFirstWalletValidAccount(selectedWallet *dcrlibwallet.Wallet) error
- func (as *AccountSelector) SelectedAccount() *dcrlibwallet.Account
- func (as *AccountSelector) SetSelectedAccount(account *dcrlibwallet.Account)
- func (as *AccountSelector) Title(title string) *AccountSelector
- func (as *AccountSelector) UpdateSelectedAccountBalance()
- type AccountSelectorModal
- func (asm *AccountSelectorModal) Dismiss()
- func (asm *AccountSelectorModal) Handle()
- func (asm *AccountSelectorModal) Layout(gtx C) D
- func (asm *AccountSelectorModal) ModalID() string
- func (asm *AccountSelectorModal) OnDismiss()
- func (asm *AccountSelectorModal) OnResume()
- func (asm *AccountSelectorModal) SetCancelable(min bool) *AccountSelectorModal
- func (asm *AccountSelectorModal) Show()
- type C
- type ConsensusItem
- type Container
- type D
- func AgendaItemWidget(gtx C, l *load.Load, consensusItem *ConsensusItem) D
- func LayoutNoAgendasFound(gtx C, l *load.Load, syncing bool) D
- func LayoutNoProposalsFound(gtx C, l *load.Load, syncing bool, category int32) D
- func MixerInfoContentWrapper(gtx C, l *load.Load, content layout.Widget) D
- func MixerInfoLayout(gtx C, l *load.Load, mixerActive bool, button layout.Widget, ...) D
- func ProposalsList(gtx C, l *load.Load, prop *ProposalItem) D
- func WalletLabel(gtx layout.Context, l *load.Load, walletName string) D
- type NavDrawer
- type NavHandler
- type ProposalItem
- type SubPage
- type TransactionRow
- type TxStatus
- type VSPSelector
- type VoteBar
- func (v *VoteBar) Layout(gtx C) D
- func (v *VoteBar) SetProposalDetails(numComment int32, publishedAt int64, token string) *VoteBar
- func (v *VoteBar) SetVoteValidityParams(eligibleVotes, requiredPercentage, passPercentage float32) *VoteBar
- func (v *VoteBar) SetYesNoVoteParams(yesVotes, noVotes float32) *VoteBar
Constants ¶
const ( Uint32Size = 32 << (^uint32(0) >> 32 & 1) // 32 or 64 MaxInt32 = 1<<(Uint32Size-1) - 1 WalletsPageID = "Wallets" )
const AccoutSelectorID = "AccountSelector"
const ModalAccountSelector = "AccountSelectorModal"
const VSPSelectorModalID = "VSPSelectorModal"
Variables ¶
var MaxWidth = unit.Dp(800)
Functions ¶
func CalculateTotalWalletsBalance ¶ added in v1.7.0
func CoinImageBySymbol ¶ added in v1.7.0
func CoinImageBySymbol(l *load.Load, coinName string) *decredmaterial.Image
CoinImageBySymbol returns image widget for supported asset coins.
func ContextDone ¶
done returns whether the context's Done channel was closed due to cancellation or exceeded deadline.
func CreateOrUpdateWalletDropDown ¶
func CreateOrUpdateWalletDropDown(l *load.Load, dwn **decredmaterial.DropDown, wallets []*dcrlibwallet.Wallet, grp uint, pos uint) *decredmaterial.DropDown
createOrUpdateWalletDropDown check for len of wallets to create dropDown, also update the list when create, update, delete a wallet.
func CreateOrderDropDown ¶
func DisableLog ¶ added in v1.7.0
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.
func DurationAgo ¶ added in v1.7.0
func EndToEndRow ¶
EndToEndRow layouts out its content on both ends of its horizontal layout.
func FormatDateOrTime ¶
func LayoutBalance ¶
LayoutBalance aligns the main and sub DCR balances horizontally, putting the sub balance at the baseline of the row.
func LayoutBalanceColor ¶ added in v1.7.0
func LayoutBalanceSize ¶
func LayoutBalanceSizeScale ¶
func LayoutTransactionRow ¶
func LayoutTransactionRow(gtx layout.Context, l *load.Load, row TransactionRow) layout.Dimensions
transactionRow is a single transaction row on the transactions and overview page. It lays out a transaction's direction, balance, status.
func RetryFunc ¶ added in v1.7.0
func RetryFunc(retryAttempts int, sleepDur time.Duration, funcDesc string, errFunc func() error) (int, error)
RetryFunc implements retry policy for processes that needs to be executed after initial failure.
func SecondsToDays ¶ added in v1.7.0
SecondsToDays takes time in seconds and returns its string equivalent in the format ddhhmm.
func StringNotEmpty ¶
func SubpageHeaderButtons ¶
func SubpageHeaderButtons(l *load.Load) (decredmaterial.IconButton, decredmaterial.IconButton)
func TimeFormat ¶
func TranslateErr ¶ added in v1.7.0
func TruncateString ¶
func TxConfirmations ¶
func TxConfirmations(l *load.Load, transaction dcrlibwallet.Transaction) int32
func UniformHorizontalPadding ¶ added in v1.7.0
func UniformPadding ¶
func WeekDayHourMinuteCalculator ¶ added in v1.7.0
Types ¶
type AccountSelector ¶
type AccountSelector struct { *load.Load *listeners.TxAndBlockNotificationListener // contains filtered or unexported fields }
func NewAccountSelector ¶
func NewAccountSelector(l *load.Load, selectedWallet *dcrlibwallet.Wallet) *AccountSelector
NewAccountSelector opens up a modal to select the desired account. If a nil value is passed for selectedWallet, then accounts for all wallets are shown, otherwise only accounts for the selectedWallet is shown.
func (*AccountSelector) AccountSelected ¶
func (as *AccountSelector) AccountSelected(callback func(*dcrlibwallet.Account)) *AccountSelector
func (*AccountSelector) AccountValidator ¶
func (as *AccountSelector) AccountValidator(accountIsValid func(*dcrlibwallet.Account) bool) *AccountSelector
func (*AccountSelector) Changed ¶ added in v1.7.0
func (as *AccountSelector) Changed() bool
func (*AccountSelector) Handle ¶
func (as *AccountSelector) Handle()
func (*AccountSelector) Layout ¶
func (as *AccountSelector) Layout(gtx C) D
func (*AccountSelector) ListenForTxNotifications ¶ added in v1.7.0
func (as *AccountSelector) ListenForTxNotifications(ctx context.Context)
func (*AccountSelector) SelectFirstWalletValidAccount ¶
func (as *AccountSelector) SelectFirstWalletValidAccount(selectedWallet *dcrlibwallet.Wallet) error
SelectFirstWalletValidAccount selects the first valid account from the first wallet in the SortedWalletList If selectedWallet is not nil, the first account for the selectWallet is selected.
func (*AccountSelector) SelectedAccount ¶
func (as *AccountSelector) SelectedAccount() *dcrlibwallet.Account
func (*AccountSelector) SetSelectedAccount ¶ added in v1.7.0
func (as *AccountSelector) SetSelectedAccount(account *dcrlibwallet.Account)
func (*AccountSelector) Title ¶
func (as *AccountSelector) Title(title string) *AccountSelector
func (*AccountSelector) UpdateSelectedAccountBalance ¶ added in v1.7.0
func (as *AccountSelector) UpdateSelectedAccountBalance()
type AccountSelectorModal ¶
func (*AccountSelectorModal) Dismiss ¶
func (asm *AccountSelectorModal) Dismiss()
func (*AccountSelectorModal) Handle ¶
func (asm *AccountSelectorModal) Handle()
func (*AccountSelectorModal) Layout ¶
func (asm *AccountSelectorModal) Layout(gtx C) D
func (*AccountSelectorModal) ModalID ¶
func (asm *AccountSelectorModal) ModalID() string
func (*AccountSelectorModal) OnDismiss ¶
func (asm *AccountSelectorModal) OnDismiss()
func (*AccountSelectorModal) OnResume ¶
func (asm *AccountSelectorModal) OnResume()
func (*AccountSelectorModal) SetCancelable ¶
func (asm *AccountSelectorModal) SetCancelable(min bool) *AccountSelectorModal
func (*AccountSelectorModal) Show ¶
func (asm *AccountSelectorModal) Show()
type ConsensusItem ¶ added in v1.7.0
type ConsensusItem struct { Agenda dcrlibwallet.Agenda VoteButton decredmaterial.Button }
func LoadAgendas ¶ added in v1.7.0
func LoadAgendas(l *load.Load, selectedWallet *dcrlibwallet.Wallet, newestFirst bool) []*ConsensusItem
type Container ¶
Container is simply a wrapper for the Inset type. Its purpose is to differentiate the use of an inset as a padding or margin, making it easier to visualize the structure of a layout when reading UI code.
type D ¶
type D = layout.Dimensions
func AgendaItemWidget ¶ added in v1.7.0
func AgendaItemWidget(gtx C, l *load.Load, consensusItem *ConsensusItem) D
func LayoutNoAgendasFound ¶ added in v1.7.0
func LayoutNoProposalsFound ¶ added in v1.7.0
func MixerInfoContentWrapper ¶ added in v1.7.0
func MixerInfoLayout ¶ added in v1.7.0
func ProposalsList ¶ added in v1.7.0
func ProposalsList(gtx C, l *load.Load, prop *ProposalItem) D
type NavDrawer ¶
type NavDrawer struct { // contains filtered or unexported fields }
func (*NavDrawer) DrawerToggled ¶
func (*NavDrawer) LayoutNavDrawer ¶
func (nd *NavDrawer) LayoutNavDrawer(gtx layout.Context) layout.Dimensions
func (*NavDrawer) LayoutTopBar ¶
func (nd *NavDrawer) LayoutTopBar(gtx layout.Context) layout.Dimensions
type NavHandler ¶
type NavHandler struct {}
type ProposalItem ¶ added in v1.7.0
type ProposalItem struct { Proposal dcrlibwallet.Proposal // contains filtered or unexported fields }
func LoadProposals ¶ added in v1.7.0
func LoadProposals(category int32, newestFirst bool, l *load.Load) []*ProposalItem
type SubPage ¶
type SubPage struct { *load.Load Title string SubTitle string WalletName string Back func() Body layout.Widget InfoTemplate string ExtraItem *decredmaterial.Clickable Extra layout.Widget ExtraText string HandleExtra func() BackButton decredmaterial.IconButton InfoButton decredmaterial.IconButton }
func (*SubPage) EventHandler ¶
func (sp *SubPage) EventHandler()
func (*SubPage) SplitLayout ¶
func (sp *SubPage) SplitLayout(gtx layout.Context) layout.Dimensions
type TransactionRow ¶
type TransactionRow struct { Transaction dcrlibwallet.Transaction Index int ShowBadge bool }
type TxStatus ¶
type TxStatus struct { Title string Icon *decredmaterial.Image // tx purchase only TicketStatus string Color color.NRGBA ProgressBarColor color.NRGBA ProgressTrackColor color.NRGBA Background color.NRGBA }
func TransactionTitleIcon ¶
func TransactionTitleIcon(l *load.Load, wal *dcrlibwallet.Wallet, tx *dcrlibwallet.Transaction, ticketSpender *dcrlibwallet.Transaction) *TxStatus
type VSPSelector ¶ added in v1.7.0
func NewVSPSelector ¶ added in v1.7.0
func NewVSPSelector(l *load.Load) *VSPSelector
func (*VSPSelector) Changed ¶ added in v1.7.0
func (v *VSPSelector) Changed() bool
func (*VSPSelector) Layout ¶ added in v1.7.0
func (v *VSPSelector) Layout(gtx layout.Context) layout.Dimensions
func (*VSPSelector) SelectVSP ¶ added in v1.7.0
func (v *VSPSelector) SelectVSP(vspHost string)
func (*VSPSelector) SelectedVSP ¶ added in v1.7.0
func (v *VSPSelector) SelectedVSP() *dcrlibwallet.VSP
func (*VSPSelector) Title ¶ added in v1.7.0
func (v *VSPSelector) Title(title string) *VSPSelector
type VoteBar ¶ added in v1.7.0
VoteBar widget implements voting stat for proposals. VoteBar shows the range/percentage of the yes votes and no votes against the total required.