modal

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: ISC Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VerifyMessageInfoTemplate      = "VerifyMessageInfo"
	SignMessageInfoTemplate        = "SignMessageInfo"
	PrivacyInfoTemplate            = "PrivacyInfo"
	SetupMixerInfoTemplate         = "ConfirmSetupMixer"
	TransactionDetailsInfoTemplate = "TransactionDetailsInfoInfo"
	WalletBackupInfoTemplate       = "WalletBackupInfo"
	AllowUnmixedSpendingTemplate   = "AllowUnmixedSpending"
	TicketPriceErrorTemplate       = "TicketPriceError"
	SecurityToolsInfoTemplate      = "SecurityToolsInfo"
	RemoveWalletInfoTemplate       = "RemoveWalletInfo"
	SetGapLimitTemplate            = "SetGapLimit"
	SourceModalInfoTemplate        = "SourceModalInfo"
	TotalValueInfoTemplate         = "TotalValueInfo"
	BondStrengthInfoTemplate       = "BondStrengthInfo"
)

Variables

This section is empty.

Functions

func DisableLog

func DisableLog()

DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info.

Types

type ButtonType

type ButtonType uint8

ButtonType is the type of button in modal.

const (
	// CustomBtn defines the bare metal custom modal button type.
	CustomBtn ButtonType = iota
	// DangerBtn defines the default danger modal button type
	DangerBtn
	// InfoBtn defines the default info modal button type
	InfoBtn
)

type C

type C = layout.Context

type ClickFunc

type ClickFunc func(isChecked bool, im *InfoModal) bool

ClickFunc defines the positive button click method signature. Adding the InfoModal parameter allow reference of the parent info modal qualities inside the positive button function call.

func DefaultClickFunc

func DefaultClickFunc() ClickFunc

DefaultClickFunc returns the default click function satisfying the positive btn click function.

type CreatePasswordModal

type CreatePasswordModal struct {
	*load.Load
	*cryptomaterial.Modal
	// contains filtered or unexported fields
}

func NewCreatePasswordModal

func NewCreatePasswordModal(l *load.Load) *CreatePasswordModal

func (*CreatePasswordModal) ConfirmPasswordHint

func (cm *CreatePasswordModal) ConfirmPasswordHint(hint string) *CreatePasswordModal

func (*CreatePasswordModal) EnableConfirmPassword

func (cm *CreatePasswordModal) EnableConfirmPassword(enable bool) *CreatePasswordModal

func (*CreatePasswordModal) EnableName

func (cm *CreatePasswordModal) EnableName(enable bool) *CreatePasswordModal

func (*CreatePasswordModal) Handle

func (cm *CreatePasswordModal) Handle()

func (*CreatePasswordModal) HandleKeyPress

func (cm *CreatePasswordModal) HandleKeyPress(evt *key.Event)

HandleKeyPress is called when one or more keys are pressed on the current window that match any of the key combinations returned by KeysToHandle(). Satisfies the load.KeyEventHandler interface for receiving key events.

func (*CreatePasswordModal) KeysToHandle

func (cm *CreatePasswordModal) KeysToHandle() key.Set

KeysToHandle returns an expression that describes a set of key combinations that this modal wishes to capture. The HandleKeyPress() method will only be called when any of these key combinations is pressed. Satisfies the load.KeyEventHandler interface for receiving key events.

func (*CreatePasswordModal) Layout

func (cm *CreatePasswordModal) Layout(gtx C) D

func (*CreatePasswordModal) LayoutComponents

func (cm *CreatePasswordModal) LayoutComponents() []layout.Widget

func (*CreatePasswordModal) NameHint

func (cm *CreatePasswordModal) NameHint(hint string) *CreatePasswordModal

func (*CreatePasswordModal) OnDismiss

func (cm *CreatePasswordModal) OnDismiss()

func (*CreatePasswordModal) OnResume

func (cm *CreatePasswordModal) OnResume()

func (*CreatePasswordModal) PasswordHint

func (cm *CreatePasswordModal) PasswordHint(hint string) *CreatePasswordModal

func (*CreatePasswordModal) SetCancelable

func (cm *CreatePasswordModal) SetCancelable(min bool) *CreatePasswordModal

func (*CreatePasswordModal) SetDescription

func (cm *CreatePasswordModal) SetDescription(description string) *CreatePasswordModal

func (*CreatePasswordModal) SetError

func (cm *CreatePasswordModal) SetError(err string)

func (*CreatePasswordModal) SetLoading

func (cm *CreatePasswordModal) SetLoading(loading bool)

func (*CreatePasswordModal) SetNegativeButtonCallback

func (cm *CreatePasswordModal) SetNegativeButtonCallback(callback func()) *CreatePasswordModal

func (*CreatePasswordModal) SetNegativeButtonText

func (cm *CreatePasswordModal) SetNegativeButtonText(text string) *CreatePasswordModal

func (*CreatePasswordModal) SetParent

func (cm *CreatePasswordModal) SetParent(parent app.Page) *CreatePasswordModal

SetParent sets the page that created PasswordModal as it's parent.

func (*CreatePasswordModal) SetPasswordTitleVisibility added in v1.1.0

func (cm *CreatePasswordModal) SetPasswordTitleVisibility(show bool)

func (*CreatePasswordModal) SetPositiveButtonCallback

func (cm *CreatePasswordModal) SetPositiveButtonCallback(callback func(walletName, password string, m *CreatePasswordModal) bool) *CreatePasswordModal

func (*CreatePasswordModal) SetPositiveButtonText

func (cm *CreatePasswordModal) SetPositiveButtonText(text string) *CreatePasswordModal

func (*CreatePasswordModal) ShowWalletInfoTip

func (cm *CreatePasswordModal) ShowWalletInfoTip(show bool) *CreatePasswordModal

func (*CreatePasswordModal) Title

func (*CreatePasswordModal) UseCustomWidget

func (cm *CreatePasswordModal) UseCustomWidget(layout layout.Widget) *CreatePasswordModal

type CreateWatchOnlyModal

type CreateWatchOnlyModal struct {
	*load.Load
	*cryptomaterial.Modal
	// contains filtered or unexported fields
}

func NewCreateWatchOnlyModal

func NewCreateWatchOnlyModal(l *load.Load) *CreateWatchOnlyModal

func (*CreateWatchOnlyModal) EnableName

func (cm *CreateWatchOnlyModal) EnableName(enable bool) *CreateWatchOnlyModal

func (*CreateWatchOnlyModal) Handle

func (cm *CreateWatchOnlyModal) Handle()

func (*CreateWatchOnlyModal) HandleKeyPress

func (cm *CreateWatchOnlyModal) HandleKeyPress(evt *key.Event)

HandleKeyPress is called when one or more keys are pressed on the current window that match any of the key combinations returned by KeysToHandle(). Satisfies the load.KeyEventHandler interface for receiving key events.

func (*CreateWatchOnlyModal) KeysToHandle

func (cm *CreateWatchOnlyModal) KeysToHandle() key.Set

KeysToHandle returns an expression that describes a set of key combinations that this modal wishes to capture. The HandleKeyPress() method will only be called when any of these key combinations is pressed. Satisfies the load.KeyEventHandler interface for receiving key events.

func (*CreateWatchOnlyModal) Layout

func (cm *CreateWatchOnlyModal) Layout(gtx layout.Context) D

func (*CreateWatchOnlyModal) OnDismiss

func (cm *CreateWatchOnlyModal) OnDismiss()

func (*CreateWatchOnlyModal) OnResume

func (cm *CreateWatchOnlyModal) OnResume()

func (*CreateWatchOnlyModal) SetCancelable

func (cm *CreateWatchOnlyModal) SetCancelable(min bool) *CreateWatchOnlyModal

func (*CreateWatchOnlyModal) SetError

func (cm *CreateWatchOnlyModal) SetError(err string)

func (*CreateWatchOnlyModal) SetLoading

func (cm *CreateWatchOnlyModal) SetLoading(loading bool)

func (*CreateWatchOnlyModal) WatchOnlyCreated

func (cm *CreateWatchOnlyModal) WatchOnlyCreated(callback func(walletName, extPubKey string, m *CreateWatchOnlyModal) bool) *CreateWatchOnlyModal

type D

type D = layout.Dimensions

type InfoModal

type InfoModal struct {
	*load.Load
	*cryptomaterial.Modal
	// contains filtered or unexported fields
}

func NewCustomModal

func NewCustomModal(l *load.Load) *InfoModal

NewCustomModal returns a modal that can be customized.

func NewErrorModal

func NewErrorModal(l *load.Load, title string, clicked ClickFunc) *InfoModal

NewErrorModal returns the default error modal UI component.

func NewSuccessModal

func NewSuccessModal(l *load.Load, title string, clicked ClickFunc) *InfoModal

NewSuccessModal returns the default success modal UI component.

func (*InfoModal) Body

func (in *InfoModal) Body(subtitle string) *InfoModal

func (*InfoModal) CheckBox

func (in *InfoModal) CheckBox(checkbox cryptomaterial.CheckBoxStyle, mustBeChecked bool) *InfoModal

func (*InfoModal) Handle

func (in *InfoModal) Handle()

func (*InfoModal) HandleKeyPress

func (in *InfoModal) HandleKeyPress(_ *key.Event)

HandleKeyPress is called when one or more keys are pressed on the current window that match any of the key combinations returned by KeysToHandle(). Satisfies the load.KeyEventHandler interface for receiving key events.

func (*InfoModal) Icon

func (in *InfoModal) Icon(icon *cryptomaterial.Image) *InfoModal

func (*InfoModal) KeysToHandle

func (in *InfoModal) KeysToHandle() key.Set

KeysToHandle returns an expression that describes a set of key combinations that this modal wishes to capture. The HandleKeyPress() method will only be called when any of these key combinations is pressed. Satisfies the load.KeyEventHandler interface for receiving key events.

func (*InfoModal) Layout

func (in *InfoModal) Layout(gtx layout.Context) D

func (*InfoModal) NegativeButtonStyle

func (in *InfoModal) NegativeButtonStyle(background, text color.NRGBA) *InfoModal

func (*InfoModal) OnDismiss

func (in *InfoModal) OnDismiss()

func (*InfoModal) OnResume

func (in *InfoModal) OnResume()

func (*InfoModal) PositiveButtonStyle

func (in *InfoModal) PositiveButtonStyle(background, text color.NRGBA) *InfoModal

func (*InfoModal) PositiveButtonWidth

func (in *InfoModal) PositiveButtonWidth(width unit.Dp) *InfoModal

func (*InfoModal) SetCancelable

func (in *InfoModal) SetCancelable(min bool) *InfoModal

func (*InfoModal) SetContentAlignment

func (in *InfoModal) SetContentAlignment(title, subTitle, btn layout.Direction) *InfoModal

func (*InfoModal) SetLoading

func (in *InfoModal) SetLoading(loading bool)

func (*InfoModal) SetNegativeButtonCallback

func (in *InfoModal) SetNegativeButtonCallback(clicked func()) *InfoModal

func (*InfoModal) SetNegativeButtonText

func (in *InfoModal) SetNegativeButtonText(text string) *InfoModal

func (*InfoModal) SetPositiveButtonCallback

func (in *InfoModal) SetPositiveButtonCallback(clicked ClickFunc) *InfoModal

func (*InfoModal) SetPositiveButtonText

func (in *InfoModal) SetPositiveButtonText(text string) *InfoModal

func (*InfoModal) SetupWithTemplate

func (in *InfoModal) SetupWithTemplate(template string) *InfoModal

for backwards compatibility.

func (*InfoModal) Title

func (in *InfoModal) Title(title string) *InfoModal

func (*InfoModal) UseCustomWidget

func (in *InfoModal) UseCustomWidget(layout layout.Widget) *InfoModal

type PasswordModal

type PasswordModal struct {
	*load.Load
	*cryptomaterial.Modal
	// contains filtered or unexported fields
}

func NewPasswordModal

func NewPasswordModal(l *load.Load) *PasswordModal

func (*PasswordModal) Description

func (pm *PasswordModal) Description(description string) *PasswordModal

func (*PasswordModal) Handle

func (pm *PasswordModal) Handle()

func (*PasswordModal) Hint

func (pm *PasswordModal) Hint(hint string) *PasswordModal

func (*PasswordModal) Layout

func (pm *PasswordModal) Layout(gtx layout.Context) D

func (*PasswordModal) NegativeButton

func (pm *PasswordModal) NegativeButton(text string, clicked func()) *PasswordModal

func (*PasswordModal) OnDismiss

func (pm *PasswordModal) OnDismiss()

func (*PasswordModal) OnResume

func (pm *PasswordModal) OnResume()

func (*PasswordModal) PositiveButton

func (pm *PasswordModal) PositiveButton(text string, clicked func(password string, m *PasswordModal) bool) *PasswordModal

func (*PasswordModal) SetCancelable

func (pm *PasswordModal) SetCancelable(min bool) *PasswordModal

func (*PasswordModal) SetError

func (pm *PasswordModal) SetError(err string)

func (*PasswordModal) SetLoading

func (pm *PasswordModal) SetLoading(loading bool)

func (*PasswordModal) Title

func (pm *PasswordModal) Title(title string) *PasswordModal

func (*PasswordModal) UseCustomWidget

func (pm *PasswordModal) UseCustomWidget(layout layout.Widget) *PasswordModal

type TextInputModal

type TextInputModal struct {
	*InfoModal
	// contains filtered or unexported fields
}

func NewTextInputModal

func NewTextInputModal(l *load.Load) *TextInputModal

func (*TextInputModal) Handle

func (tm *TextInputModal) Handle()

func (*TextInputModal) Hint

func (tm *TextInputModal) Hint(hint string) *TextInputModal

func (*TextInputModal) Layout

func (tm *TextInputModal) Layout(gtx layout.Context) D

func (*TextInputModal) OnResume

func (tm *TextInputModal) OnResume()

func (*TextInputModal) PositiveButtonStyle

func (tm *TextInputModal) PositiveButtonStyle(background, text color.NRGBA) *TextInputModal

func (*TextInputModal) SetCancelable

func (tm *TextInputModal) SetCancelable(min bool) *TextInputModal

func (*TextInputModal) SetError

func (tm *TextInputModal) SetError(err string)

func (*TextInputModal) SetLoading

func (tm *TextInputModal) SetLoading(loading bool)

func (*TextInputModal) SetPositiveButtonCallback

func (tm *TextInputModal) SetPositiveButtonCallback(callback func(string, *TextInputModal) bool) *TextInputModal

func (*TextInputModal) SetText

func (tm *TextInputModal) SetText(text string) *TextInputModal

SetText replaces the content of this editor with the provided text.

func (*TextInputModal) SetTextWithTemplate

func (tm *TextInputModal) SetTextWithTemplate(template string, walletName ...string) *TextInputModal

func (*TextInputModal) ShowAccountInfoTip

func (tm *TextInputModal) ShowAccountInfoTip(show bool) *TextInputModal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL