button

package
v0.0.0-...-6513b37 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const IconSize = 38
View Source
const UnreadColorDefs = `
	@define-color mentioned rgb(240, 71, 71);
`

Variables

This section is empty.

Functions

This section is empty.

Types

type CollapsibleLabel

type CollapsibleLabel struct{}

type ToggleButton

type ToggleButton struct {
	gtk.ToggleButton
	Label *rich.Label

	// These fields are nil if image is false.
	Image *roundimage.StillImage

	Box *gtk.Box
	// contains filtered or unexported fields
}

func NewToggleButton

func NewToggleButton(state rich.LabelStateStorer) *ToggleButton

NewToggleButton creates a new toggle button.

func (*ToggleButton) GetShowLabel

func (b *ToggleButton) GetShowLabel() bool

GetShowLabel gets whether or not the label is being shown.

func (*ToggleButton) SetClicked

func (b *ToggleButton) SetClicked(clicked func(bool))

SetClicked sets the callback to run when clicked. It overrides the previous callback.

func (*ToggleButton) SetClickedIfTrue

func (b *ToggleButton) SetClickedIfTrue(clickedIfTrue func())

func (*ToggleButton) SetFailed

func (b *ToggleButton) SetFailed(err error, retry func())

func (*ToggleButton) SetLoading

func (b *ToggleButton) SetLoading()

SetLoading sets the button's state to loading.

func (*ToggleButton) SetNormal

func (b *ToggleButton) SetNormal()

SetNormal sets the button's state to normal from either loading or failed.

func (*ToggleButton) SetPlaceholderIcon

func (b *ToggleButton) SetPlaceholderIcon(iconName string, iconSzPx int)

func (*ToggleButton) SetSelected

func (b *ToggleButton) SetSelected(selected bool)

SetSelected sets the button's intermediate state and appearance to look like it's clicked without triggering the callback.

func (*ToggleButton) SetShowLabel

func (b *ToggleButton) SetShowLabel(showLabel bool)

SetShowLabel sets whether or not to show the button's label. If the button does not have an image, then the label is always shown.

func (*ToggleButton) SetUnreadUnsafe

func (b *ToggleButton) SetUnreadUnsafe(unread, mentioned bool)

func (*ToggleButton) UseEmptyIcon

func (b *ToggleButton) UseEmptyIcon()

UseEmptyIcon forces the ToggleButton to show an icon, even if it's a placeholder.

Jump to

Keyboard shortcuts

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