popup

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	PopupAvatarSize = 48
	PopupWidth      = 240

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

Variables

This section is empty.

Functions

This section is empty.

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.Snowflake
	Guild discord.Snowflake

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

func NewStatefulPopupBody

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

func NewStatefulPopupUser

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

func (*StatefulPopupBody) AddUnhandler

func (s *StatefulPopupBody) AddUnhandler(u func())

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.Snowflake, ids []discord.Snowflake) (*UserPopupRoles, error)

thread-safe

Jump to

Keyboard shortcuts

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