appwidget

package
v0.0.0-...-4b42cdd Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: MIT, Unlicense Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type C

type C = layout.Context

type D

type D = layout.Dimensions

type SuggestionAcceptedEvent

type SuggestionAcceptedEvent[T comparable] struct {
	// Suggestion is the chosen entity.
	Suggestion T
}

SuggestionAcceptedEvent indicates that the user has chosen a suggestion.

func (SuggestionAcceptedEvent[T]) ImplementsEvent

func (SuggestionAcceptedEvent[T]) ImplementsEvent()

type SuggestionCancelEvent

type SuggestionCancelEvent[T any] struct{}

SuggestionCancelEvent indicates that the editor in the entity no longer wants suggestions for entities to insert.

func (SuggestionCancelEvent[T]) ImplementsEvent

func (SuggestionCancelEvent[T]) ImplementsEvent()

type SuggestionCreateNewEvent

type SuggestionCreateNewEvent[T any] struct {
	Text string
}

SuggestionCreateNewEvent indicates that the user has requested to make a new entity from the current input text.

func (SuggestionCreateNewEvent[T]) ImplementsEvent

func (SuggestionCreateNewEvent[T]) ImplementsEvent()

type SuggestionRequestEvent

type SuggestionRequestEvent[T any] struct {
	// Text is the user composition to base the suggestions upon.
	Text string
}

SuggestionRequestEvent indicates that the editor in the entity wants suggestions for entities to insert.

func (SuggestionRequestEvent[T]) ImplementsEvent

func (SuggestionRequestEvent[T]) ImplementsEvent()

type Suggestor

type Suggestor[T comparable] struct {
	Current int
	Options widget.List
	// After the first layout, there should always be one more clickable
	// than entity. The final clickable is used for the "create new entity"
	// option.
	Clickables []*widget.Clickable
	Entities   []T
	// contains filtered or unexported fields
}

Suggestor displays suggestions for an editor.

func (*Suggestor[T]) Events

func (s *Suggestor[T]) Events() []event.Event

Events returns any events generated since the previous call to Events.

func (*Suggestor[T]) Layout

func (s *Suggestor[T]) Layout(gtx C) D

Layout updates the state of the Suggestor with events from the gtx.

type TransactionSubmittedEvent

type TransactionSubmittedEvent struct {
	Value ledger.Transaction
}

type TxChangedEvent

type TxChangedEvent struct{}

func (TxChangedEvent) ImplementsEvent

func (TxChangedEvent) ImplementsEvent()

type TxEditor

type TxEditor struct {
	Editor widget.Editor

	Suggestor Suggestor[string]
	// contains filtered or unexported fields
}

func (*TxEditor) Events

func (e *TxEditor) Events() []interface{}

func (*TxEditor) Layout

func (e *TxEditor) Layout(gtx C, editor layout.Widget) D

func (*TxEditor) ResolveSuggestionCreate

func (e *TxEditor) ResolveSuggestionCreate(createdTag string)

ResolveSuggestionCreate should be invoked when the entity requested by SuggestionCreateNewEvent is created.

func (*TxEditor) SetSuggestions

func (e *TxEditor) SetSuggestions(suggestions []string)

func (*TxEditor) Suggesting

func (e *TxEditor) Suggesting() bool

type TxForm

type TxForm struct {
	DateEditor  widget.Editor
	PayeeEditor TxEditor
	Rows        []*TxRow
	Hints       []string
	SubmitBtn   widget.Clickable
	// contains filtered or unexported fields
}

func (*TxForm) Events

func (t *TxForm) Events() (events []any)

func (*TxForm) IsValid

func (t *TxForm) IsValid() bool

func (*TxForm) Layout

func (t *TxForm) Layout(gtx C, w layout.Widget) D

func (*TxForm) Reset

func (t *TxForm) Reset()

func (*TxForm) SetAccountSuggestions

func (t *TxForm) SetAccountSuggestions(suggestions []string)

type TxRow

type TxRow struct {
	Account TxEditor
	Amount  widget.Editor
	Hint    string
	Message string
}

func (*TxRow) Populated

func (t *TxRow) Populated() bool

func (*TxRow) Reset

func (t *TxRow) Reset()

func (*TxRow) Valid

func (t *TxRow) Valid() (account, amount bool)

func (*TxRow) Value

func (t *TxRow) Value() ledger.Account

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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