cozy

package
v0.0.0-...-6513b37 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const AvatarSize = message.AvatarSize

Variables

This section is empty.

Functions

func NewMessage

func NewMessage(
	s *message.State, before container.MessageRow) container.MessageRow

NewMessage creates a new message.

func NewPresendMessage

func NewPresendMessage(
	s *message.PresendState, before container.MessageRow) container.PresendMessageRow

NewPresendMessage creates a new presend message.

Types

type Avatar

type Avatar struct {
	roundimage.Button
	Image *roundimage.StillImage
	// contains filtered or unexported fields
}

func NewAvatar

func NewAvatar(parent primitives.Connector) *Avatar

func (*Avatar) SetImage

func (a *Avatar) SetImage(img rich.LabelImage)

SetImage sets the avatar from the given label image.

func (*Avatar) SetURL

func (a *Avatar) SetURL(url string)

SetURL updates the Avatar to be that URL. It does nothing if URL is empty or matches the existing one.

type CollapsedMessage

type CollapsedMessage struct {
	// Author is still updated normally.
	*message.State
}

Collapsed is a message that follows after FullMessage. It does not show the header, and the avatar is invisible.

func WrapCollapsedMessage

func WrapCollapsedMessage(gc *message.State) *CollapsedMessage

WrapCollapsedMessage wraps the given message state to be a collapsed message.

func (*CollapsedMessage) Revert

func (c *CollapsedMessage) Revert() *message.State

type CollapsedSendingMessage

type CollapsedSendingMessage struct {
	*CollapsedMessage
	message.Presender
}

func WrapCollapsedSendingMessage

func WrapCollapsedSendingMessage(pstate *message.PresendState) *CollapsedSendingMessage

type Container

type Container struct {
	*container.ListContainer
}

func NewContainer

func NewContainer(ctrl container.Controller) *Container

func (*Container) AddMessageAt

func (c *Container) AddMessageAt(msgr container.MessageRow, ix int)

AddMessage adds the given message.

func (*Container) CreateMessage

func (c *Container) CreateMessage(msg cchat.MessageCreate)

func (*Container) DeleteMessage

func (c *Container) DeleteMessage(msg cchat.MessageDelete)

func (*Container) NewPresendMessage

func (c *Container) NewPresendMessage(state *message.PresendState) container.PresendMessageRow

func (*Container) UpdateMessage

func (c *Container) UpdateMessage(msg cchat.MessageUpdate)

type FullMessage

type FullMessage struct {
	*message.State

	// Grid widgets.
	Avatar  *Avatar
	MainBox *gtk.Box // wraps header and content

	HeaderLabel *labeluri.Label
	// contains filtered or unexported fields
}

func NewFullMessage

func NewFullMessage(msg cchat.MessageCreate) *FullMessage

func WrapFullMessage

func WrapFullMessage(gc *message.State) *FullMessage

func (*FullMessage) Revert

func (m *FullMessage) Revert() *message.State

type FullSendingMessage

type FullSendingMessage struct {
	*FullMessage
	message.Presender
}

func WrapFullSendingMessage

func WrapFullSendingMessage(pstate *message.PresendState) *FullSendingMessage

Jump to

Keyboard shortcuts

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