guild

package
v0.0.5-0...-0379fef Latest Latest
Warning

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

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

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func BindName

func BindName(container gtkutils.Container, w wrapper, name *string) *gtk.EventBox

func BindNameDirect

func BindNameDirect(conn binder, 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 *gtk.Image
	IURL  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
}

type GuildFolderIcon

type GuildFolderIcon struct {

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

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

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

type Guilds

type Guilds struct {
	gtkutils.ExtendedWidget

	ListBox  *gtk.ListBox
	DMButton *DMButton

	Current  *Guild
	OnSelect func(g *Guild)
	// contains filtered or unexported fields
}

func NewGuilds

func NewGuilds(s *ningen.State) (g *Guilds, err error)

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

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

func (*Guilds) TraverseReadState

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

type Hoverable

type Hoverable interface {
	SetHovered(hovered bool)
}

type RevealerRow

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

type UnreadStrip

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

func NewUnreadStrip(child gtk.IWidget) *UnreadStrip

func (*UnreadStrip) FromRow

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

func (*UnreadStrip) SetActive

func (r *UnreadStrip) SetActive(active bool)

func (*UnreadStrip) SetHovered

func (r *UnreadStrip) SetHovered(hovered bool)

func (*UnreadStrip) SetPinged

func (r *UnreadStrip) SetPinged()

func (*UnreadStrip) SetRead

func (r *UnreadStrip) SetRead()

func (*UnreadStrip) SetSuppress

func (r *UnreadStrip) SetSuppress(suppressed bool)

func (*UnreadStrip) SetUnread

func (r *UnreadStrip) SetUnread()

func (*UnreadStrip) State

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