ui

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 18 Imported by: 2

Documentation

Index

Constants

View Source
const (
	RowInputEventId = iota
	RowCloseEventId
)
View Source
const (
	TextAreaCmdEventId = iota
	TextAreaSelectAnnotationEventId
	TextAreaInlineCompleteEventId
	TextAreaInputEventId
	TextAreaLayoutEventId
)
View Source
const (
	ColumnCloseEventId = iota
)
View Source
const (
	RootSelectAnnotationEventId = iota
)

Variables

View Source
var ColorThemeCycler cycler = cycler{
	// contains filtered or unexported fields
}
View Source
var FontThemeCycler cycler = cycler{
	// contains filtered or unexported fields
}
View Source
var ScrollBarLeft = true
View Source
var ScrollBarWidth int = 0 // 0=based on a portion of the font size
View Source
var (
	ShadowsOn = true
)
View Source
var TTFontOptions truetype.Options
View Source
var TextAreaCommentsColor color.Color
View Source
var TextAreaStringsColor color.Color
View Source
var UIThemeUtil uiThemeUtil

Functions

func AddUserFont

func AddUserFont(filename string) error

func ThemeFontFace added in v1.3.0

func ThemeFontFace(name string) (*fontutil.FontFace, error)

func ThemeFontFace2 added in v1.3.0

func ThemeFontFace2(name string, size float64) (*fontutil.FontFace, error)

func WrapInBottomShadowOrNone

func WrapInBottomShadowOrNone(ctx widget.ImageContext, content widget.Node) widget.Node

func WrapInTopShadowOrSeparator

func WrapInTopShadowOrSeparator(ctx widget.ImageContext, content widget.Node) widget.Node

Types

type ColSeparator

type ColSeparator struct {
	*widget.Separator
	// contains filtered or unexported fields
}

func NewColSeparator

func NewColSeparator(col *Column) *ColSeparator

func (*ColSeparator) OnInputEvent

func (sh *ColSeparator) OnInputEvent(ev0 any, p image.Point) event.Handled

type Column

type Column struct {
	*widget.BoxLayout
	RowsLayout *widget.SplBg // exported to access sp values
	Cols       *Columns
	EvReg      evreg.Register
	// contains filtered or unexported fields
}

func NewColumn

func NewColumn(cols *Columns) *Column

func (*Column) Close

func (col *Column) Close()

func (*Column) FirstChildRow

func (col *Column) FirstChildRow() *Row

func (*Column) LastChildRow

func (col *Column) LastChildRow() *Row

func (*Column) Layout

func (col *Column) Layout()

func (*Column) NewRowBefore

func (col *Column) NewRowBefore(next *Row) *Row

func (*Column) PointNextRow

func (col *Column) PointNextRow(p *image.Point) (*Row, bool)

func (*Column) PointNextRowExtra

func (col *Column) PointNextRowExtra(p *image.Point) (*Row, bool)

func (*Column) Rows

func (col *Column) Rows() []*Row

type ColumnCloseEvent

type ColumnCloseEvent struct {
	Col *Column
}

type ColumnSquare

type ColumnSquare struct {
	widget.ENode
	Size image.Point
	// contains filtered or unexported fields
}

func NewColumnSquare

func NewColumnSquare(col *Column) *ColumnSquare

func (*ColumnSquare) Measure

func (sq *ColumnSquare) Measure(hint image.Point) image.Point

func (*ColumnSquare) OnInputEvent

func (sq *ColumnSquare) OnInputEvent(ev any, p image.Point) event.Handled

func (*ColumnSquare) Paint

func (sq *ColumnSquare) Paint()

type Columns

type Columns struct {
	widget.ENode
	ColsLayout *widget.SplBg // exported to access sp values
	Root       *Root
}

func NewColumns

func NewColumns(root *Root) *Columns

func (*Columns) Columns

func (cols *Columns) Columns() []*Column

func (*Columns) FirstChildColumn

func (cols *Columns) FirstChildColumn() *Column

func (*Columns) InsertBefore

func (cols *Columns) InsertBefore(col widget.Node, next *widget.EmbedNode)

func (*Columns) InsertColumnBefore

func (cols *Columns) InsertColumnBefore(col, next *Column)

func (*Columns) LastChildColumn

func (cols *Columns) LastChildColumn() *Column

func (*Columns) NewColumn

func (cols *Columns) NewColumn() *Column

func (*Columns) PointColumn

func (cols *Columns) PointColumn(p *image.Point) (*Column, bool)

func (*Columns) PointColumnExtra

func (cols *Columns) PointColumnExtra(p *image.Point) (*Column, bool)

type ContextFloatBox

type ContextFloatBox struct {
	*widget.FloatBox

	TextArea *TextArea
	// contains filtered or unexported fields
}

func NewContextFloatBox

func NewContextFloatBox(root *Root) *ContextFloatBox

func (*ContextFloatBox) AutoClose

func (cfb *ContextFloatBox) AutoClose(ev any, p image.Point)

func (*ContextFloatBox) FindTextAreaUnderPointer

func (cfb *ContextFloatBox) FindTextAreaUnderPointer() (*TextArea, bool)

func (*ContextFloatBox) Layout

func (cfb *ContextFloatBox) Layout()

func (*ContextFloatBox) OnInputEvent

func (cfb *ContextFloatBox) OnInputEvent(ev any, p image.Point) event.Handled

func (*ContextFloatBox) SetRefPointToTextAreaCursor

func (cfb *ContextFloatBox) SetRefPointToTextAreaCursor(ta *TextArea)

func (*ContextFloatBox) SetStrClearHistory

func (cfb *ContextFloatBox) SetStrClearHistory(s string)

func (*ContextFloatBox) Toggle

func (cfb *ContextFloatBox) Toggle()
type MainMenuButton struct {
	*widget.FloatBoxButton

	Toolbar *Toolbar
	// contains filtered or unexported fields
}

func NewMainMenuButton

func NewMainMenuButton(root *Root) *MainMenuButton

type Root

type Root struct {
	*widget.MultiLayer
	UI              *UI
	Toolbar         *Toolbar
	MainMenuButton  *MainMenuButton
	ContextFloatBox *ContextFloatBox
	Cols            *Columns
	EvReg           evreg.Register
}

User Interface root (top) node.

func NewRoot

func NewRoot(ui *UI) *Root

func (*Root) Init

func (root *Root) Init()

func (*Root) OnChildMarked

func (l *Root) OnChildMarked(child widget.Node, newMarks widget.Marks)

func (*Root) OnInputEvent added in v1.1.0

func (l *Root) OnInputEvent(ev0 any, p image.Point) event.Handled

type RootSelectAnnotationEvent added in v1.1.0

type RootSelectAnnotationEvent struct {
	Type RootSelectAnnotationType
}

type RootSelectAnnotationType added in v1.1.0

type RootSelectAnnotationType int
const (
	RootSelAnnTypeFirst RootSelectAnnotationType = iota
	RootSelAnnTypeLast
	RootSelAnnTypePrev
	RootSelAnnTypeNext
	RootSelAnnTypeClear
)

type Row

type Row struct {
	*widget.BoxLayout
	Toolbar  *RowToolbar
	TextArea *TextArea
	Col      *Column
	EvReg    evreg.Register

	ScrollArea *widget.ScrollArea
	// contains filtered or unexported fields
}

func NewRow

func NewRow(col *Column) *Row

func (*Row) Close

func (row *Row) Close()

func (*Row) EnsureOneToolbarLineYVisible added in v1.1.0

func (row *Row) EnsureOneToolbarLineYVisible()

func (*Row) EnsureTextAreaMinimumHeight

func (row *Row) EnsureTextAreaMinimumHeight()

func (*Row) HasState

func (row *Row) HasState(s RowState) bool

func (*Row) Layout

func (row *Row) Layout()

func (*Row) Maximize

func (row *Row) Maximize()

func (*Row) NextRow

func (row *Row) NextRow() *Row

func (*Row) OnChildMarked

func (row *Row) OnChildMarked(child widget.Node, newMarks widget.Marks)

func (*Row) OnInputEvent

func (row *Row) OnInputEvent(ev0 any, p image.Point) event.Handled

func (*Row) PosBelow

func (row *Row) PosBelow() *RowPos

func (*Row) SetState

func (row *Row) SetState(s RowState, v bool)

type RowCloseEvent

type RowCloseEvent struct {
	Row *Row
}

type RowInputEvent

type RowInputEvent struct {
	Row   *Row
	Event any
}

type RowPos

type RowPos struct {
	Column  *Column
	NextRow *Row
}

func NewRowPos

func NewRowPos(col *Column, nextRow *Row) *RowPos

type RowSeparator

type RowSeparator struct {
	*widget.Separator
	// contains filtered or unexported fields
}

func NewRowSeparator

func NewRowSeparator(row *Row) *RowSeparator

func (*RowSeparator) OnInputEvent

func (sh *RowSeparator) OnInputEvent(ev0 any, p image.Point) event.Handled

type RowSquare

type RowSquare struct {
	widget.ENode
	Size image.Point
	// contains filtered or unexported fields
}

func NewRowSquare

func NewRowSquare(row *Row) *RowSquare

func (*RowSquare) HasState

func (sq *RowSquare) HasState(s RowState) bool

func (*RowSquare) Measure

func (sq *RowSquare) Measure(hint image.Point) image.Point

func (*RowSquare) OnInputEvent

func (sq *RowSquare) OnInputEvent(ev any, p image.Point) event.Handled

func (*RowSquare) Paint

func (sq *RowSquare) Paint()

func (*RowSquare) SetState

func (sq *RowSquare) SetState(s RowState, v bool)

type RowState

type RowState uint16
const (
	RowStateActive RowState = 1 << iota
	RowStateExecuting
	RowStateEdited
	RowStateFsDiffer
	RowStateNotExist
	RowStateDuplicate
	RowStateDuplicateHighlight
	RowStateAnnotations
	RowStateAnnotationsEdited
)

type RowToolbar

type RowToolbar struct {
	*Toolbar
	Square *RowSquare
}

func NewRowToolbar

func NewRowToolbar(row *Row) *RowToolbar

func (*RowToolbar) Layout

func (tb *RowToolbar) Layout()

func (*RowToolbar) OnThemeChange

func (tb *RowToolbar) OnThemeChange()

type TASelAnnType

type TASelAnnType int
const (
	TasatPrev TASelAnnType = iota
	TasatNext
	TasatMsg
	TasatMsgPrev
	TasatMsgNext
	TasatPrint
	TasatPrintPreviousAll
)

type TextArea

type TextArea struct {
	*widget.TextEditX

	EvReg                       evreg.Register
	SupportClickInsideSelection bool
	// contains filtered or unexported fields
}

func NewTextArea

func NewTextArea(ui *UI) *TextArea

func (*TextArea) Layout added in v1.1.0

func (ta *TextArea) Layout()

func (*TextArea) OnInputEvent

func (ta *TextArea) OnInputEvent(ev0 any, p image.Point) event.Handled

func (*TextArea) PointIndexInsideSelection

func (ta *TextArea) PointIndexInsideSelection(p image.Point) bool

type TextAreaCmdEvent

type TextAreaCmdEvent struct {
	TextArea *TextArea
	Index    int
}

type TextAreaInlineCompleteEvent

type TextAreaInlineCompleteEvent struct {
	TextArea *TextArea
	Offset   int

	ReplyHandled event.Handled // allow callbacks to set value
}

type TextAreaInputEvent added in v1.3.0

type TextAreaInputEvent struct {
	TextArea     *TextArea
	Event        any
	ReplyHandled event.Handled
}

type TextAreaLayoutEvent added in v1.3.0

type TextAreaLayoutEvent struct {
	TextArea *TextArea
}

type TextAreaSelectAnnotationEvent

type TextAreaSelectAnnotationEvent struct {
	TextArea        *TextArea
	AnnotationIndex int
	Offset          int // annotation string click offset
	Type            TASelAnnType
}

type Toolbar

type Toolbar struct {
	*TextArea
	// contains filtered or unexported fields
}

func NewToolbar

func NewToolbar(ui *UI) *Toolbar

func (*Toolbar) Layout

func (tb *Toolbar) Layout()

func (*Toolbar) OnInputEvent added in v1.3.0

func (tb *Toolbar) OnInputEvent(ev any, p image.Point) event.Handled

type UI

type UI struct {
	*uiutil.BasicUI
	Root    *Root
	OnError func(error)
}

func NewUI

func NewUI(winName string) (*UI, error)

func (*UI) Error added in v1.3.0

func (ui *UI) Error(err error)

func (*UI) GoodRowPos

func (ui *UI) GoodRowPos() *RowPos

func (*UI) WarpPointerToRectanglePad

func (ui *UI) WarpPointerToRectanglePad(r image.Rectangle)

Jump to

Keyboard shortcuts

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