guild

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FolderSize  = 32
	IconSize    = 48
	IconPadding = 8
	TotalWidth  = IconSize + IconPadding*3
)

Variables

This section is empty.

Functions

func BindName added in v0.0.4

func BindName(c gtk.Containerer, w gtk.Widgetter, name *string) *gtk.EventBox

func BindNameDirect added in v0.0.4

func BindNameDirect(w gtk.Widgetter, hoverer Hoverable, name *string)

Types

type DMButton

type DMButton struct {
	*gtk.ListBoxRow
	Unread *UnreadStrip

	OnClick func()
	// contains filtered or unexported fields
}

func NewPMButton

func NewPMButton(s *ningen.State) (dm *DMButton)

thread-safe

type Guild

type Guild struct {
	*gtk.ListBoxRow
	Parent *GuildFolder
	Unread *UnreadStrip

	Event *gtk.EventBox
	Image *avatar.Image

	IconURL   string
	BannerURL string

	ID   discord.GuildID
	Name string
	// contains filtered or unexported fields
}

func (*Guild) SetUnavailable

func (g *Guild) SetUnavailable(unavailable bool)

func (*Guild) UpdateImage

func (g *Guild) UpdateImage()

type GuildFolder

type GuildFolder struct {
	// Row that belongs to the parent list.
	*RevealerRow

	Icon *GuildFolderIcon
	Name string

	// Child list.
	List *gtk.ListBox

	Guilds   []*Guild
	Revealed bool
	// contains filtered or unexported fields
}

type GuildFolderIcon added in v0.0.4

type GuildFolderIcon struct {
	// Main stack, switches between "guilds" and "folder"
	*gtk.Stack
	Style *gtk.StyleContext

	Guilds *gtk.Grid        // contains 4 images always.
	Images [4]*avatar.Image // first 4 of folder.Guilds

	Folder *gtk.Image
	// contains filtered or unexported fields
}

func (*GuildFolderIcon) SetPlayAnimation added in v0.1.0

func (i *GuildFolderIcon) SetPlayAnimation(play bool)

type Guilds

type Guilds struct {
	gtk.Widgetter

	ListBox  *gtk.ListBox
	DMButton *DMButton

	Guilds   []gtk.Widgetter
	Current  *Guild
	OnSelect func(g *Guild)
	// contains filtered or unexported fields
}

func NewGuilds

func NewGuilds(s *ningen.State) *Guilds

func (*Guilds) Find

func (guilds *Guilds) Find(fn func(*Guild) bool) (*Guild, *GuildFolder)

func (*Guilds) FindByID

func (guilds *Guilds) FindByID(guildID discord.GuildID) (*Guild, *GuildFolder)

func (*Guilds) Select added in v0.0.4

func (g *Guilds) Select(r *gtk.ListBoxRow)

func (*Guilds) TraverseReadState

func (guilds *Guilds) TraverseReadState(rs *read.UpdateEvent)

type Hoverable added in v0.0.4

type Hoverable interface {
	SetHovered(hovered bool)
}

type RevealerRow added in v0.0.4

type RevealerRow struct {
	*gtk.ListBoxRow
	Strip    *UnreadStrip
	Button   *gtk.Button
	Revealer *gtk.Revealer
}

type UnreadStrip added in v0.0.4

type UnreadStrip struct {
	*gtk.Overlay // contains child

	Revealer *gtk.Revealer
	Strip    *gtk.Box // width IconPadding
	Style    *gtk.StyleContext
	// contains filtered or unexported fields
}

func NewUnreadStrip added in v0.0.4

func NewUnreadStrip(child gtk.Widgetter) *UnreadStrip

func (*UnreadStrip) FromRow added in v0.0.4

func (r *UnreadStrip) FromRow(row *gtk.ListBoxRow)

func (*UnreadStrip) SetActive added in v0.0.4

func (r *UnreadStrip) SetActive(active bool)

func (*UnreadStrip) SetHovered added in v0.0.4

func (r *UnreadStrip) SetHovered(hovered bool)

func (*UnreadStrip) SetPinged added in v0.0.4

func (r *UnreadStrip) SetPinged()

func (*UnreadStrip) SetRead added in v0.0.4

func (r *UnreadStrip) SetRead()

func (*UnreadStrip) SetSuppress added in v0.0.4

func (r *UnreadStrip) SetSuppress(suppressed bool)

func (*UnreadStrip) SetUnread added in v0.0.4

func (r *UnreadStrip) SetUnread()

func (*UnreadStrip) State added in v0.0.4

func (r *UnreadStrip) State() (unread, pinged bool)

Jump to

Keyboard shortcuts

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