popup

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: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PopupAvatarSize = 96
	PopupImageSize  = 48 // rich presence image
	PopupWidth      = 240

	OfflineColor = 0x747F8D
	BusyColor    = 0xF04747
	IdleColor    = 0xFAA61A
	OnlineColor  = 0x43B581
)
View Source
const SectionPadding = 10

Variables

This section is empty.

Functions

func NewButton added in v0.0.4

func NewButton(markup string, callback func()) *gtk.ModelButton

func NewModelButton added in v0.0.4

func NewModelButton(markup string) *gtk.ModelButton

Types

type Popover

type Popover struct {
	*gtk.Popover
	Style *gtk.StyleContext

	Children gtk.Widgetter
	// contains filtered or unexported fields
}

func NewDynamicPopover

func NewDynamicPopover(relative gtk.Widgetter, create PopoverCreator) *Popover

func NewPopover

func NewPopover(relative gtk.Widgetter) *Popover

func (*Popover) SetChildren

func (p *Popover) SetChildren(children gtk.Widgetter)

type PopoverCreator

type PopoverCreator = func(p *gtk.Popover) gtk.Widgetter

PopoverCreator describes a popover creator function.

type StatefulPopupBody

type StatefulPopupBody struct {
	*UserPopupBody

	ParentStyle *gtk.StyleContext

	UserID  discord.UserID
	GuildID discord.GuildID

	Prefetch *discord.User
	// contains filtered or unexported fields
}

func NewStatefulPopupBody

func NewStatefulPopupBody(s *ningen.State, user discord.UserID, guild discord.GuildID) *StatefulPopupBody

func NewStatefulPopupUser

func NewStatefulPopupUser(s *ningen.State, user discord.User, guild discord.GuildID) *StatefulPopupBody

func (*StatefulPopupBody) Destroy

func (s *StatefulPopupBody) Destroy()

func (*StatefulPopupBody) UpdateActivity

func (s *StatefulPopupBody) UpdateActivity(a *discord.Activity)

type UserPopup

type UserPopup struct {
	*Popover
	*UserPopupBody
}

func NewUserPopup

func NewUserPopup(relative gtk.Widgetter) *UserPopup

not thread safe

func NewUserPopupCustom

func NewUserPopupCustom(relative gtk.Widgetter, body *UserPopupBody) *UserPopup

not thread safe

func (*UserPopup) UpdateActivity

func (b *UserPopup) UpdateActivity(a *discord.Activity)

type UserPopupActivity

type UserPopupActivity struct {
	*gtk.Box

	Header *gtk.Label

	Custom bool

	Details *gtk.Box
	Image   *gtk.Image
	Info    *gtk.Label
	// contains filtered or unexported fields
}

func NewUserPopupActivity

func NewUserPopupActivity() *UserPopupActivity

func (*UserPopupActivity) Update

func (a *UserPopupActivity) Update(ac discord.Activity)

type UserPopupBody

type UserPopupBody struct {
	*gtk.Grid
	GridMax int

	Avatar      *roundimage.Image
	AvatarStyle *gtk.StyleContext // .avatar

	Username *gtk.Label

	Activity *UserPopupActivity
	// contains filtered or unexported fields
}

func NewUserPopupBody

func NewUserPopupBody() *UserPopupBody

func (*UserPopupBody) Attach

func (b *UserPopupBody) Attach(w gtk.Widgetter, row int)

row > 0

func (*UserPopupBody) Update

func (b *UserPopupBody) Update(u discord.User)

func (*UserPopupBody) UpdateActivity

func (b *UserPopupBody) UpdateActivity(a *discord.Activity)

func (*UserPopupBody) UpdateMember

func (b *UserPopupBody) UpdateMember(m discord.Member)

func (*UserPopupBody) UpdateMemberPart

func (b *UserPopupBody) UpdateMemberPart(nick string, u discord.User)

func (*UserPopupBody) UpdateStatus

func (b *UserPopupBody) UpdateStatus(status gateway.Status)

type UserPopupRole

type UserPopupRole struct {
	*gtk.FlowBoxChild
	Main *gtk.Label
}

type UserPopupRoles

type UserPopupRoles struct {
	*gtk.Box
	Header *gtk.Label

	// can be nil
	Main  *gtk.FlowBox
	Roles []UserPopupRole
}

func NewUserPopupRoles

func NewUserPopupRoles(s *ningen.State, guildID discord.GuildID, uID discord.UserID) *UserPopupRoles

Jump to

Keyboard shortcuts

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