scrollarea

package
v0.0.0-...-af996ba Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// StdTheme is the theme all new ScrollAreas get by default.
	StdTheme = NewTheme()
)

Functions

This section is empty.

Types

type Behavior

type Behavior int

Behavior controls how auto-sizing of the scroll content's preferred size is handled.

const (
	Unmodified Behavior = iota
	FillWidth
	FillHeight
	Fill
)

Possible ways to handle auto-sizing of the scroll content's preferred size.

type ScrollArea

type ScrollArea struct {
	widget.Block
	Theme *Theme // The theme the ScrollArea will use to draw itself.
	// contains filtered or unexported fields
}

ScrollArea provides a widget that can hold another widget and show it through a scrollable viewport.

func New

func New(content ui.Widget, behavior Behavior) *ScrollArea

New creates a new ScrollArea with the specified block as its content. The content may be nil.

func (*ScrollArea) Content

func (sa *ScrollArea) Content() ui.Widget

Content returns the content block.

func (*ScrollArea) ContentSize

func (sa *ScrollArea) ContentSize(horizontal bool) float64

ContentSize implements Scrollable.

func (*ScrollArea) LineScrollAmount

func (sa *ScrollArea) LineScrollAmount(horizontal, towardsStart bool) float64

LineScrollAmount implements Pager and Scrollable.

func (*ScrollArea) PageScrollAmount

func (sa *ScrollArea) PageScrollAmount(horizontal, towardsStart bool) float64

PageScrollAmount implements Pager and Scrollable.

func (*ScrollArea) ScrolledPosition

func (sa *ScrollArea) ScrolledPosition(horizontal bool) float64

ScrolledPosition implements Scrollable.

func (*ScrollArea) SetContent

func (sa *ScrollArea) SetContent(content ui.Widget, behavior Behavior)

SetContent sets the content block, replacing any existing one.

func (*ScrollArea) SetScrolledPosition

func (sa *ScrollArea) SetScrolledPosition(horizontal bool, position float64)

SetScrolledPosition implements Scrollable.

func (*ScrollArea) VisibleSize

func (sa *ScrollArea) VisibleSize(horizontal bool) float64

VisibleSize implements Scrollable.

type Theme

type Theme struct {
	Border      border.Border // The border to use when not focused.
	FocusBorder border.Border // The border to use when focused.
}

Theme contains the theme elements for ScrollAreas.

func NewTheme

func NewTheme() *Theme

NewTheme creates a new ScrollArea theme.

func (*Theme) Init

func (theme *Theme) Init()

Init initializes the theme with its default values.

Jump to

Keyboard shortcuts

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