sidebar

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package sidebar contains the sidebar showing guilds and channels.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sidebar struct {
	*gtk.Box // horizontal

	Left   *gtk.Box
	DMView *directbutton.View
	Guilds *guilds.View
	Right  *gtk.Stack
	// contains filtered or unexported fields
}

Sidebar is the bar on the left side of the application once it's logged in.

func NewSidebar

func NewSidebar(ctx context.Context) *Sidebar

NewSidebar creates a new Sidebar.

func (*Sidebar) GuildID

func (s *Sidebar) GuildID() discord.GuildID

GuildID returns the guild ID that the channel list is showing for, if any. If not, 0 is returned.

func (*Sidebar) OpenDMs

func (s *Sidebar) OpenDMs() *direct.ChannelView

func (*Sidebar) SelectChannel

func (s *Sidebar) SelectChannel(chID discord.ChannelID)

SelectChannel selects and activates the channel with the given ID. It ensures that the sidebar is at the right place then activates the controller. This function acts the same as if the user clicked on the channel, meaning it funnels down to a single widget that then floats up to the controller.

func (*Sidebar) SetSelectedGuild

func (s *Sidebar) SetSelectedGuild(guildID discord.GuildID)

SetSelectedGuild marks the guild with the given ID as selected.

func (*Sidebar) Unselect

func (s *Sidebar) Unselect()

Unselect unselects the current guild or channel.

Directories

Path Synopsis
Package unread contains state structures to synchronize the guild and channel views.
Package unread contains state structures to synchronize the guild and channel views.

Jump to

Keyboard shortcuts

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