widget

package
v0.0.17-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animation added in v0.0.16

type Animation struct {
	anim.Normal

	Collection map[*forest.Reply]*ReplyAnimationState
	// contains filtered or unexported fields
}

Animation maintains animation states per reply.

func (*Animation) Lookup added in v0.0.16

func (a *Animation) Lookup(r *forest.Reply, s ReplyStatus) *ReplyAnimationState

Lookup animation state for the given reply. If state doesn't exist, it will be created with using `s` as the beginning status.

func (*Animation) Update added in v0.0.16

func (a *Animation) Update(gtx layout.Context, r *forest.Reply, s ReplyStatus) *ReplyAnimationState

Update animation state for the given reply.

type Composer added in v0.0.4

type Composer struct {
	CommunityList layout.List
	Community     widget.Enum

	SendButton, CancelButton, PasteButton widget.Clickable
	widget.Editor

	ReplyingTo ds.ReplyData
	// contains filtered or unexported fields
}

Composer holds the state for a widget that creates new arbor nodes.

func (Composer) Composing added in v0.0.15

func (c Composer) Composing() bool

Composing indicates whether the composer is composing a message of any kind.

func (*Composer) ComposingConversation added in v0.0.15

func (c *Composer) ComposingConversation() bool

ComposingConversation returns whether the composer is currently creating a conversation (rather than a new reply within an existing conversation)

func (*Composer) Events added in v0.0.15

func (c *Composer) Events() (out []ComposerEvent)

Events returns state change events for the composer since the last call to events.

func (*Composer) Layout added in v0.0.15

func (c *Composer) Layout(gtx layout.Context) layout.Dimensions

Layout updates the state of the composer

func (*Composer) Reset added in v0.0.15

func (c *Composer) Reset()

Reset clears the internal state of the composer.

func (*Composer) StartConversation added in v0.0.15

func (c *Composer) StartConversation()

StartConversation configures the composer to write a new conversation.

func (*Composer) StartReply added in v0.0.15

func (c *Composer) StartReply(to ds.ReplyData)

StartReply configures the composer to write a reply to the provided ReplyData.

type ComposerEvent added in v0.0.15

type ComposerEvent uint

ComposerEvent represents a change in the Composer's state

const (
	ComposerSubmitted ComposerEvent = iota
	ComposerCancelled
)

type MessageList added in v0.0.16

type MessageList struct {
	layout.List
	States
	ShouldHide     func(reply ds.ReplyData) bool
	StatusOf       func(reply ds.ReplyData) ReplyStatus
	HiddenChildren func(reply ds.ReplyData) int
	UserIsActive   func(identity *fields.QualifiedHash) bool
	Animation
}

type Polyclick added in v0.0.13

type Polyclick struct {
	Pass bool
	gesture.Click
	// contains filtered or unexported fields
}

Polyclick can detect and report a variety of gesture interactions within a single pointer input area.

func (*Polyclick) Clicks added in v0.0.13

func (p *Polyclick) Clicks() (out []widget.Click)

func (*Polyclick) Layout added in v0.0.13

func (p *Polyclick) Layout(gtx layout.Context) layout.Dimensions

func (*Polyclick) LongPressed added in v0.0.13

func (p *Polyclick) LongPressed() bool

type Reply

type Reply struct {
	Hash    *fields.QualifiedHash
	Content string
	Polyclick
}

Reply holds ui state for each reply.

func (*Reply) WithContent added in v0.0.12

func (r *Reply) WithContent(s string) *Reply

func (*Reply) WithHash added in v0.0.12

func (r *Reply) WithHash(h *fields.QualifiedHash) *Reply

type ReplyAnimationState added in v0.0.16

type ReplyAnimationState struct {
	*anim.Normal
	Begin, End ReplyStatus
}

ReplyAnimationState holds the state of an in-progress animation for a reply. The anim.Normal field defines how far through the animation the node is, and the Begin and End fields define the two states that the node is transitioning between.

type ReplyStatus added in v0.0.16

type ReplyStatus int
const (
	None ReplyStatus = 1 << iota
	Sibling
	Selected
	Ancestor
	Descendant
	ConversationRoot
	// Anchor indicates that this node is visible, but its descendants have been
	// hidden.
	Anchor
	// Hidden indicates that this node is not currently visible.
	Hidden
)

type States added in v0.0.16

type States struct {
	Buffer  []Reply
	Current int
}

States implements a buffer of reply states such that memory is reused each frame, yet grows as the view expands to hold more replies.

func (*States) Begin added in v0.0.16

func (s *States) Begin()

Begin resets the buffer to the start.

func (*States) Next added in v0.0.16

func (s *States) Next() *Reply

type TextForm added in v0.0.9

type TextForm struct {
	TextField    materials.TextField
	SubmitButton widget.Clickable
	PasteButton  widget.Clickable
	// contains filtered or unexported fields
}

TextForm holds the theme-independent state of a simple form that allows a user to provide a single text value and supports pasting. It can be submitted with either the submit button or pressing enter on the keyboard.

func (*TextForm) Layout added in v0.0.9

func (c *TextForm) Layout(gtx layout.Context) layout.Dimensions

func (*TextForm) Submitted added in v0.0.9

func (c *TextForm) Submitted() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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