widget

package
v0.0.0-...-69d9917 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT, Unlicense Imports: 5 Imported by: 0

Documentation

Overview

Package widget provides stateful widget types for building chat interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedImage

type CachedImage struct {
	// contains filtered or unexported fields
}

CachedImage is a cacheable image operation.

func (*CachedImage) Cache

func (img *CachedImage) Cache(src image.Image) *CachedImage

Cache the image if it is not already. First call will compute the image operation, subsequent calls will noop. When reloaded, cache will re-populated on next invocation.

func (CachedImage) Op

func (img CachedImage) Op() paint.ImageOp

Op returns the concrete image operation.

func (*CachedImage) Reload

func (img *CachedImage) Reload()

Reload tells the CachedImage to repopulate the cache.

type Message

type Message struct {
	richtext.InteractiveText
	// Clickable tracks clicks on the message image.
	widget.Clickable
	// Image contains the cached image op for the message.
	Image CachedImage
}

Message holds the state necessary to facilitate user interactions with messages across frames.

type Row

type Row struct {
	// ContextArea holds the clicks state for the right-click context menu.
	component.ContextArea

	Message
	UserInfo
}

Row holds persistent state for a single row of a chat.

type UserInfo

type UserInfo struct {
	Avatar CachedImage
}

UserInfo holds persistent state for displaying a user's information.

Directories

Path Synopsis
Package material provides material design building blocks for chat interfaces.
Package material provides material design building blocks for chat interfaces.
Package plato implements themed styles for Plato Team Inc.
Package plato implements themed styles for Plato Team Inc.

Jump to

Keyboard shortcuts

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