label

package
v0.0.0-...-955f326 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2020 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CellFactory

type CellFactory struct {
	Height float64
}

CellFactory provides a simple implementation of a CellFactory that uses Labels for its cells.

func (*CellFactory) CellHeight

func (f *CellFactory) CellHeight() float64

CellHeight implements widget.CellFactory.

func (*CellFactory) CreateCell

func (f *CellFactory) CreateCell(owner *ux.Panel, element interface{}, index int, selected, focused bool) *ux.Panel

CreateCell implements widget.CellFactory.

type Label

type Label struct {
	ux.Panel
	// contains filtered or unexported fields
}

Label represents non-interactive text and/or an image.

func New

func New() *Label

New creates a new, empty label.

func (*Label) DefaultDraw

func (l *Label) DefaultDraw(gc draw.Context, dirty geom.Rect, inLiveResize bool)

DefaultDraw provides the default drawing.

func (*Label) DefaultSizes

func (l *Label) DefaultSizes(hint geom.Size) (min, pref, max geom.Size)

DefaultSizes provides the default sizing.

func (*Label) Font

func (l *Label) Font() *draw.Font

Font returns the font that will be used when drawing text content.

func (*Label) Gap

func (l *Label) Gap() float64

Gap returns the gap to put between the image and text.

func (*Label) HAlign

func (l *Label) HAlign() align.Alignment

HAlign returns the horizontal alignment.

func (*Label) Image

func (l *Label) Image() *draw.Image

Image returns the image. May be nil.

func (*Label) Ink

func (l *Label) Ink() draw.Ink

Ink returns the ink that will be used when drawing text content.

func (*Label) SetBorder

func (l *Label) SetBorder(value border.Border) *Label

SetBorder sets the border. May be nil.

func (*Label) SetEnabled

func (l *Label) SetEnabled(enabled bool) *Label

SetEnabled sets enabled state.

func (*Label) SetFocusable

func (l *Label) SetFocusable(focusable bool) *Label

SetFocusable whether it can have the keyboard focus.

func (*Label) SetFont

func (l *Label) SetFont(value *draw.Font) *Label

SetFont sets the font that will be used when drawing text content. Pass in nil to use the default.

func (*Label) SetGap

func (l *Label) SetGap(value float64) *Label

SetGap sets the gap to put between the image and text.

func (*Label) SetHAlign

func (l *Label) SetHAlign(value align.Alignment) *Label

SetHAlign sets the horizontal alignment.

func (*Label) SetImage

func (l *Label) SetImage(value *draw.Image) *Label

SetImage sets the image. May be nil.

func (*Label) SetInk

func (l *Label) SetInk(value draw.Ink) *Label

SetInk sets the ink that will be used when drawing text content. Pass in nil to use the default.

func (*Label) SetSide

func (l *Label) SetSide(value side.Side) *Label

SetSide sets the side of the text the image should be on.

func (*Label) SetText

func (l *Label) SetText(value string) *Label

SetText sets the text content.

func (*Label) SetVAlign

func (l *Label) SetVAlign(value align.Alignment) *Label

SetVAlign sets the vertical alignment.

func (*Label) Side

func (l *Label) Side() side.Side

Side returns the side of the text the image should be on.

func (*Label) Text

func (l *Label) Text() string

Text returns the text content.

func (*Label) VAlign

func (l *Label) VAlign() align.Alignment

VAlign returns the vertical alignment.

Jump to

Keyboard shortcuts

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