views

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package views provides individual composable views for the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppBinder

type AppBinder interface {
	Session() bluetooth.Session
	Features() *appfeatures.FeatureSet

	QueueDraw(drawFunc func())
	InstantDraw(drawFunc func())
	Refresh()
	FocusPrimitive(primitive tview.Primitive)

	Suspend(t tcell.Screen)
	StartSuspend()
	GetFocused() tview.Primitive
	Close()
}

AppBinder binds all the root application's functions to the views manager (Views).

type AppData

type AppData struct {
	// layout holds the layout of the application.
	Layout         *tview.Flex
	InitialFocus   *tview.Flex
	MouseFunc      func(event *tcell.EventMouse, action tview.MouseAction) (*tcell.EventMouse, tview.MouseAction)
	BeforeDrawFunc func(t tcell.Screen) bool
	InputCapture   func(event *tcell.EventKey) *tcell.EventKey
}

AppData holds all the necessary layout and event handling data for the root application to initialize. This is passed to the application once all the views are initialized using Views.Initialize.

type HelpData

type HelpData struct {
	Title, Description string
	Keys               []keybindings.Key
	ShowInStatus       bool
}

HelpData describes the help item.

type Views

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

Views holds all the views as well as different managers for the view layouts, operations and actions.

func NewViews

func NewViews() *Views

NewViews returns a new Views instance.

func (*Views) Authorizer

func (v *Views) Authorizer() bluetooth.SessionAuthorizer

Authorizer returns an authorization manager.

func (*Views) Initialize

func (v *Views) Initialize(binder AppBinder, cfg *config.Config) (*AppData, error)

Initialize initializes all the views.

Jump to

Keyboard shortcuts

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