channel

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChannelsWidth = 240
	BannerHeight  = 135
	LabelHeight   = 48
)
View Source
const (
	DMAvatarSize = 38
	IconPadding  = 8
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	gtkutils.ExtendedWidget

	Row   *gtk.ListBoxRow
	Style *gtk.StyleContext

	Label *gtk.Label

	ID       discord.Snowflake
	Guild    discord.Snowflake
	Name     string
	Topic    string
	Category bool
	// contains filtered or unexported fields
}

func (*Channel) ChannelID

func (ch *Channel) ChannelID() discord.Snowflake

func (*Channel) ChannelInfo

func (ch *Channel) ChannelInfo() (name, topic string)

func (*Channel) GuildID

func (ch *Channel) GuildID() discord.Snowflake

type Channels

type Channels struct {
	*gtk.ScrolledWindow
	Main *gtk.Box

	GuildID discord.Snowflake

	// Headers
	BannerImage *gtk.Image

	// Channel list
	ChList   *gtk.ListBox
	Channels []*Channel
	Selected *Channel

	OnSelect func(ch *Channel)
	// contains filtered or unexported fields
}

func NewChannels

func NewChannels(state *ningen.State) (chs *Channels)

func (*Channels) Cleanup

func (chs *Channels) Cleanup()

func (*Channels) FindByID

func (chs *Channels) FindByID(id discord.Snowflake) *Channel

func (*Channels) First

func (chs *Channels) First() *Channel

func (*Channels) LoadGuild

func (chs *Channels) LoadGuild(guildID discord.Snowflake) error

func (*Channels) TraverseReadState

func (chs *Channels) TraverseReadState(s *ningen.State, rs *gateway.ReadState, unread bool)

func (*Channels) UpdateBanner

func (chs *Channels) UpdateBanner(url string)

type PrivateChannel

type PrivateChannel struct {
	*gtk.ListBoxRow
	Style *gtk.StyleContext

	Body *user.Container

	ID   discord.Snowflake
	Name string

	Group bool
	// contains filtered or unexported fields
}

func (*PrivateChannel) ChannelID

func (pc *PrivateChannel) ChannelID() discord.Snowflake

func (*PrivateChannel) ChannelInfo

func (pc *PrivateChannel) ChannelInfo() (name, topic string)

func (*PrivateChannel) GuildID

func (pc *PrivateChannel) GuildID() discord.Snowflake

type PrivateChannels

type PrivateChannels struct {
	*gtk.Box

	List   *gtk.ListBox
	Scroll *gtk.ScrolledWindow

	Search *gtk.Entry

	// Channels map[discord.Snowflake]*PrivateChannel
	Channels map[string]*PrivateChannel

	OnSelect func(pm *PrivateChannel)
	// contains filtered or unexported fields
}

func NewPrivateChannels

func NewPrivateChannels(s *ningen.State) (pcs *PrivateChannels)

thread-safe

func (*PrivateChannels) Cleanup

func (pcs *PrivateChannels) Cleanup()

func (*PrivateChannels) FindByID

func (pcs *PrivateChannels) FindByID(id discord.Snowflake) *PrivateChannel

func (*PrivateChannels) LoadChannels

func (pcs *PrivateChannels) LoadChannels() error

thread-safe

func (*PrivateChannels) Selected

func (pcs *PrivateChannels) Selected() *PrivateChannel

func (*PrivateChannels) TraverseReadState

func (pcs *PrivateChannels) TraverseReadState(_ *ningen.State, rs *gateway.ReadState, unread bool)

Jump to

Keyboard shortcuts

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