memberlist

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: 15 Imported by: 0

Documentation

Index

Constants

View Source
const AvatarSize = 32

Variables

View Source
var MemberListWidth = 250

Functions

This section is empty.

Types

type Container

type Container struct {
	*gtk.Revealer
	Scroll *gtk.ScrolledWindow
	Main   *gtk.Box

	// map id -> *Section
	Sections map[string]*Section
	// contains filtered or unexported fields
}

func New

func New(ctrl Controller) *Container

func (*Container) IsEmpty

func (c *Container) IsEmpty() bool

IsEmpty returns whether or not the member view container is empty.

func (*Container) RemoveMember

func (c *Container) RemoveMember(sectionID string, id string)

func (*Container) RemoveMemberUnsafe

func (c *Container) RemoveMemberUnsafe(sectionID string, id string)

func (*Container) Reset

func (c *Container) Reset()

Reset removes all old sections.

func (*Container) SetMember

func (c *Container) SetMember(sectionID string, member cchat.ListMember)

func (*Container) SetMemberUnsafe

func (c *Container) SetMemberUnsafe(sectionID string, member cchat.ListMember)

func (*Container) SetSections

func (c *Container) SetSections(sections []cchat.MemberSection)

func (*Container) SetSectionsUnsafe

func (c *Container) SetSectionsUnsafe(sections []cchat.MemberSection)

func (*Container) TryAsyncList

func (c *Container) TryAsyncList(server cchat.Messenger)

TryAsyncList tries to set the member list from the given server. It does type assertions and handles asynchronicity. Reset must be called before this.

type Controller

type Controller interface {
	MemberListUpdated(c *Container)
}

type EventQueuer

type EventQueuer interface {
	Activate()
	Deactivate()
}

type Member

type Member struct {
	*gtk.ListBoxRow
	Main *gtk.Box

	Avatar *roundimage.StillImage
	Name   *rich.Label
	// contains filtered or unexported fields
}

func NewMember

func NewMember(member cchat.ListMember) *Member

func (*Member) Popup

func (m *Member) Popup(evq EventQueuer)

Popup pops up the mention popover if any.

func (*Member) Update

func (m *Member) Update(member cchat.ListMember)

type Section

type Section struct {
	*gtk.Box

	ID string

	Header *rich.Label
	Body   *gtk.ListBox

	// map id -> *Member
	Members map[string]*Member
	// contains filtered or unexported fields
}

func NewSection

func NewSection(sect cchat.MemberSection, evq EventQueuer) *Section

func (*Section) Destroy

func (s *Section) Destroy()

func (*Section) RemoveMember

func (s *Section) RemoveMember(id string)

func (*Section) SetMember

func (s *Section) SetMember(member cchat.ListMember)

func (*Section) Update

func (s *Section) Update(sect cchat.MemberSection)

Jump to

Keyboard shortcuts

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