util

package
v0.0.0-...-af7c746 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusPageName   = "status"
	BranchesPageName = "branches"
	ReposPageName    = "repos"
)

Variables

This section is empty.

Functions

func NewErrorWindow

func NewErrorWindow(pages *tview.Pages, name string, err error)

func ReadCommitMessage

func ReadCommitMessage(app *tview.Application, filename string) (string, error)

Types

type FlexElement

type FlexElement struct {
	Primitive    tview.Primitive
	FixedSize    int
	RelativeSize int
	Focus        bool
}

type FloatingWindow

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

func NewFloatingWindow

func NewFloatingWindow(
	upperRow, lowerRow, leftColumn, rightColumn FlexElement,
	columnFixedSize, columnRelativeSize int,
	pages *tview.Pages,
	name string,
	focus bool,
	elements ...FlexElement,
) *FloatingWindow

func NewMiddleFloatingWindow

func NewMiddleFloatingWindow(pages *tview.Pages, name string, focus bool, elements ...FlexElement) *FloatingWindow

func NewStatusFloatingWindow

func NewStatusFloatingWindow(pages *tview.Pages, name string, focus bool, elements ...FlexElement) *FloatingWindow

The status page has a header for each column, and so the upper padding needs to be a bit larger otherwise the window will render a bit oddly.

func NewTextNotificationWindow

func NewTextNotificationWindow(pages *tview.Pages, name, text string) *FloatingWindow

func (*FloatingWindow) Hide

func (f *FloatingWindow) Hide()

func (*FloatingWindow) Show

func (f *FloatingWindow) Show()

type Keybinding

type Keybinding struct {
	Key         string
	Description string
	Action      func()
}

type Page

type Page struct {
	MainFlex *tview.Flex
}

func NewPage

func NewPage(primitive tview.Primitive, keybindings []Keybinding) Page

type State

type State struct {
	App        *tview.Application
	Pages      *tview.Pages
	Repository *git.Repository
	Branch     string
}

Jump to

Keyboard shortcuts

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