fieldview

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldView

type FieldView struct {
	// contains filtered or unexported fields
}

FieldView is a Viewer for a field. Cursor is an element for drawing in selected field

func New

func New(fielder FocusFielder, font *impress.Font, foreground fn.Color, cursor view.Viewer) *FieldView

New creates a FieldView

func (*FieldView) Draw

func (v *FieldView) Draw(w *impress.Window, rect image.Rectangle)

Draw draws a view element

func (*FieldView) Size

func (v *FieldView) Size(size image.Point) image.Point

Size returns size of a view element

type FieldWithFocused

type FieldWithFocused struct {
	Fielder
	// contains filtered or unexported fields
}

FieldWithFocused contains a field with focused state func

func WithFocused

func WithFocused(field Fielder, isFocused fn.Bool) *FieldWithFocused

WithFocused returns a FieldWithFocused

func (*FieldWithFocused) Focused

func (m *FieldWithFocused) Focused() bool

Focused returns a focused flag

type Fielder

type Fielder interface {
	String() string
	Cursor() int
}

Fielder is an interface of a field model

type FocusFielder

type FocusFielder interface {
	Fielder
	Focused() bool
}

FocusFielder is an interface of a field model with a focused flag

Jump to

Keyboard shortcuts

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