userbutton

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Toggle

type Toggle struct {
	*gtk.ToggleButton
	MenuItems []gtkutil.PopoverMenuItem
	// contains filtered or unexported fields
}

Toggle is a toggle button showing the user avatar. It shows a PopoverMenu when clicked.

func NewToggle

func NewToggle(ctx context.Context) *Toggle

NewToggle creates a new Toggle instance. It takes parameters similar to NewPopover.

func (*Toggle) InvalidateAvatar

func (t *Toggle) InvalidateAvatar()

InvalidateAvatar updates the avatar. NewToggle will call this function on its own.

func (*Toggle) SetMenuFunc

func (t *Toggle) SetMenuFunc(f func() []gtkutil.PopoverMenuItem)

SetMenuFunc sets the menu function. The function is invoked everytime the PopoverMenu is created.

func (*Toggle) SetPopoverFunc

func (t *Toggle) SetPopoverFunc(f func(*gtk.PopoverMenu))

SetPopoverFunc sets the function to be called when a Popover is spawned.

Jump to

Keyboard shortcuts

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