ui

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ModUnselected = `[ ]`
	ModSelected   = `[🗸]`
	ModDone       = ` 🗸 `
	ModError      = ` 🗴 `
)
View Source
var (
	WindowTheme paint.Theme
)

Functions

This section is empty.

Types

type CPackage

type CPackage struct {
	Project *CProject

	Module *update.Module

	HBox    ctk.HBox
	Button  ctk.Button
	Label   ctk.Label
	ThisVer ctk.Label
	NextVer ctk.Label

	Error ctk.Label
	// contains filtered or unexported fields
}

func (*CPackage) GoModUpdate

func (p *CPackage) GoModUpdate()

func (*CPackage) Resize

func (p *CPackage) Resize()

func (*CPackage) UpdateButton

func (p *CPackage) UpdateButton()

type CProject

type CProject struct {
	Path string
	Name string

	Frame ctk.Frame
	VBox  ctk.VBox

	Packages []*CPackage
	// contains filtered or unexported fields
}

func (*CProject) Add

func (p *CProject) Add(modules ...*update.Module)

func (*CProject) Height

func (p *CProject) Height() (h int)

func (*CProject) Pending

func (p *CProject) Pending() (count int)

func (*CProject) Refresh

func (p *CProject) Refresh()

func (*CProject) Resize

func (p *CProject) Resize()

func (*CProject) UpdateTitle

func (p *CProject) UpdateTitle()

type CUI

type CUI struct {
	App ctk.Application

	ContentVBox ctk.VBox
	ActionHBox  ctk.HButtonBox
	Display     cdk.Display
	Window      ctk.Window

	QuitButton     ctk.Button
	UpdateButton   ctk.Button
	DiscoverButton ctk.Button

	ErrorList     ctk.VBox
	ProjectList   ctk.VBox
	StatusLabel   ctk.Label
	StateSpinner  ctk.Spinner
	ContentScroll ctk.ScrolledViewport

	LastError error

	Projects Projects

	sync.RWMutex
	// contains filtered or unexported fields
}

func NewUI

func NewUI(name string, usage string, description string, version string, tag string, title string, ttyPath string) (u *CUI)

func (*CUI) Run

func (u *CUI) Run(argv []string) (err error)

func (*CUI) SetState

func (u *CUI) SetState(state State)

func (*CUI) State

func (u *CUI) State() (state State)

type Projects

type Projects []*CProject

func (Projects) Height

func (p Projects) Height() (height int)

func (Projects) Refresh

func (p Projects) Refresh()

func (Projects) Resize

func (p Projects) Resize()

type State

type State uint8
const (
	InitState State = iota
	IdleState
	DiscoveryState
	UpdatingState
	EndOfStates
)

func (State) Idle

func (s State) Idle() (idle bool)

func (State) Valid

func (s State) Valid() (valid bool)

Jump to

Keyboard shortcuts

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