liteview

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

dashline

package liteview is a fyne widget for reading text

Index

Constants

View Source
const (
	DefaultDashlineHeight   = 1
	DefaultDashlineWidth    = 5
	DefaultDashlineInterval = 2
)
View Source
const (
	DefaultSidePadding         = 50
	DefaultVerticalPadding     = 20
	DefaultLineVerticalPadding = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DashedLine

type DashedLine struct {
	*image.RGBA
	// contains filtered or unexported fields
}

func NewDashedLine

func NewDashedLine(w, h float32, dashW, dashInt float32, c color.Color) (line *DashedLine)

type LiteView

type LiteView struct {
	widget.DisableableWidget

	StartLine, StartLinePos int
	// contains filtered or unexported fields
}

func NewLiteViewCustom

func NewLiteViewCustom(p fyne.Window, options ...Option) *LiteView

func (*LiteView) CreateRenderer

func (lv *LiteView) CreateRenderer() fyne.WidgetRenderer

func (*LiteView) FocusGained

func (lv *LiteView) FocusGained()

func (*LiteView) FocusLost

func (lv *LiteView) FocusLost()

func (*LiteView) Focused

func (lv *LiteView) Focused() bool

func (*LiteView) GetPos

func (lv *LiteView) GetPos() (int, int)

GetPos returns current starting rune line and rune line pos

func (*LiteView) GetUnderLine

func (lv *LiteView) GetUnderLine() UnderLineMode

func (*LiteView) GetVal

func (lv *LiteView) GetVal() [][]byte

func (*LiteView) JumpTo

func (lv *LiteView) JumpTo(lineid, linepos int, centralview bool)

JumpTo display the text starting from line lineid and postion within line specified by linepos; if certralview is true, the specified postion is postioned verifically centrally, otherwise the specified postion starts from top of viewarea; if the specified postion is invalid, do nothing

func (*LiteView) MouseIn

func (lv *LiteView) MouseIn(evt *desktop.MouseEvent)

func (*LiteView) MouseMoved

func (lv *LiteView) MouseMoved(evt *desktop.MouseEvent)

func (*LiteView) MouseOut

func (lv *LiteView) MouseOut()

func (*LiteView) Scrolled

func (lv *LiteView) Scrolled(evt *fyne.ScrollEvent)

func (*LiteView) SetBytes

func (lv *LiteView) SetBytes(val [][]byte)

func (*LiteView) SetKeyEvtHandler

func (lv *LiteView) SetKeyEvtHandler(f func(*fyne.KeyEvent))

func (*LiteView) SetPosEvtHandler

func (lv *LiteView) SetPosEvtHandler(f func(int, int))

func (*LiteView) SetStr

func (lv *LiteView) SetStr(val string)

func (*LiteView) SetUnderLine

func (lv *LiteView) SetUnderLine(underline UnderLineMode)

func (*LiteView) TypedKey

func (lv *LiteView) TypedKey(evt *fyne.KeyEvent)

func (*LiteView) TypedRune

func (lv *LiteView) TypedRune(c rune)

func (*LiteView) Val

func (lv *LiteView) Val() [][]byte

type Option

type Option func(lv *LiteView)

func WithLeadingSpaces

func WithLeadingSpaces(count int) Option

func WithStartingPos

func WithStartingPos(lineid, linepos int) Option

func WithUnderline

func WithUnderline(u UnderLineMode) Option

func WithValBytes

func WithValBytes(val [][]byte) Option

type UnderLineMode

type UnderLineMode uint32
const (
	UnderLineNone UnderLineMode = iota
	UnderLineSolid
	UnderLineDash
)

Jump to

Keyboard shortcuts

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