Documentation ¶
Index ¶
- Constants
- type Folder
- type FolderButton
- type Guild
- type View
- func (v *View) AddGuild(guild *discord.Guild)
- func (v *View) Guild(id discord.GuildID) *Guild
- func (v *View) Invalidate()
- func (v *View) InvalidateUnreads()
- func (v *View) RemoveGuild(id discord.GuildID) *Guild
- func (v *View) SelectedGuildID() discord.GuildID
- func (v *View) SetFolders(folders []gateway.GuildFolder)
- func (v *View) SetGuilds(guilds []discord.Guild)
- func (v *View) SetGuildsFromIDs(guildIDs []discord.GuildID)
- func (v *View) SetSelectedGuild(id discord.GuildID)
- func (v *View) Unselect()
- type ViewChild
Constants ¶
const ( FolderSize = 32 FolderMiniSize = 16 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Folder ¶
type Folder struct { *gtk.Box Button struct { *gtk.Overlay Pill *sidebutton.Pill Folder *FolderButton } Revealer *gtk.Revealer GuildBox *gtk.Box Guilds []*Guild // contains filtered or unexported fields }
Folder is the widget containing the folder icon on top and a child list of guilds beneath it.
func (*Folder) InvalidateUnread ¶
func (f *Folder) InvalidateUnread()
InvalidateUnread invalidates the folder's unread state.
func (*Folder) Set ¶
func (f *Folder) Set(folder *gateway.GuildFolder)
Set sets a fresh list of guilds.
func (*Folder) SetSelected ¶
SetSelected sets the folder's selected state.
type FolderButton ¶
type FolderButton struct { *gtk.Button // Main stack, switches between "guilds" and "folder" MainStack *gtk.Stack GuildGrid *gtk.Grid // contains 4 images always. FolderIcon *gtk.Image Images [4]*onlineimage.Avatar // first 4 of folder.Guilds Mentions *sidebutton.MentionsIndicator // contains filtered or unexported fields }
FolderButton is the folder icon containing the four guild icons.
func NewFolderButton ¶
func NewFolderButton(ctx context.Context) *FolderButton
NewFolderButton creates a new FolderButton.
func (*FolderButton) SetColor ¶
func (b *FolderButton) SetColor(color discord.Color)
SetColor sets the color of the folder.
func (*FolderButton) SetIcons ¶
func (b *FolderButton) SetIcons(guildIDs []discord.GuildID)
SetIcons sets the guild icons to be shown.
func (*FolderButton) SetRevealed ¶
func (b *FolderButton) SetRevealed(revealed bool)
SetRevealed sets what the FolderButton should show depending on if the folder is revealed/opened or not.
type Guild ¶
type Guild struct { *sidebutton.Button // contains filtered or unexported fields }
Guild is a widget showing a single guild icon.
func (*Guild) Invalidate ¶
func (g *Guild) Invalidate()
Invalidate invalidates and updates the state of the guild.
func (*Guild) InvalidateUnread ¶
func (g *Guild) InvalidateUnread()
InvalidateUnread invalidates the guild's unread state.
func (*Guild) ParentFolder ¶
ParentFolder returns the guild's parent folder.
func (*Guild) SetParentFolder ¶
SetParentFolder sets the parent guild folder.
func (*Guild) SetUnavailable ¶
func (g *Guild) SetUnavailable()
SetUnavailable sets the guild as unavailable. It stays unavailable until either Invalidate sees it or Update is called on it.
type View ¶
type View struct { *gtk.Box Children []ViewChild // contains filtered or unexported fields }
View contains a list of guilds and folders.
func (*View) Invalidate ¶
func (v *View) Invalidate()
Invalidate invalidates the view and recreates everything. Use with care.
func (*View) InvalidateUnreads ¶
func (v *View) InvalidateUnreads()
InvalidateUnreads invalidates the unread states of all guilds.
func (*View) RemoveGuild ¶
RemoveGuild removes the given guild.
func (*View) SelectedGuildID ¶
SelectedGuildID returns the selected guild ID, if any.
func (*View) SetFolders ¶
func (v *View) SetFolders(folders []gateway.GuildFolder)
SetFolders sets the guild folders to use.
func (*View) SetGuildsFromIDs ¶
SetGuildsFromIDs calls SetGuilds with guilds fetched from the state by the given ID list.
func (*View) SetSelectedGuild ¶
SetSelectedGuild sets the selected guild. It does not propagate the selection to the sidebar.