popup

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: 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

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

func NewModelButton

func NewModelButton(markup string) *gtk.ModelButton

Types

type Popover

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

	Children gtkutils.WidgetDestroyer
	// contains filtered or unexported fields
}

func NewDynamicPopover

func NewDynamicPopover(relative gtkutils.WidgetConnector, create PopoverCreator) *Popover

func NewPopover

func NewPopover(relative gtk.IWidget) *Popover

func (*Popover) SetChildren

func (p *Popover) SetChildren(children gtkutils.WidgetDestroyer)

type PopoverCreator

type PopoverCreator = func(p *gtk.Popover) gtkutils.WidgetDestroyer

type StatefulPopupBody

type StatefulPopupBody struct {
	*UserPopupBody

	ParentStyle *gtk.StyleContext

	User  discord.UserID
	Guild 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.IWidget) *UserPopup

not thread safe

func NewUserPopupCustom

func NewUserPopupCustom(relative gtk.IWidget, 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)

func (*UserPopupActivity) UpdateUnsafe

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

type UserPopupBody

type UserPopupBody struct {
	*gtk.Grid
	GridMax int

	Avatar      *gtk.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.IWidget, 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 discord.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,
	guild discord.GuildID, ids []discord.RoleID) (*UserPopupRoles, error)

thread-safe

Jump to

Keyboard shortcuts

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