gui

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FetchMode puts the gui in fetch state
	FetchMode ModeID = "fetch"
	// PullMode puts the gui in pull state
	PullMode = "pull"
	// MergeMode puts the gui in merge state
	MergeMode = "merge"
	// CheckoutMode checkout selected repositories
	CheckoutMode = "checkout"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffStatDecorationRules

type DiffStatDecorationRules struct {
	MaxNameLength        int
	MaxChangeCountLength int
	MaxChangesLength     int
}

DiffStatDecorationRules is a rule set for creating diffstat text

type DiffStatItem

type DiffStatItem struct {
	FileName    string
	ChangeCount string
	Changes     string
}

DiffStatItem is a line of a diff stat

type DynamicViewMode

type DynamicViewMode string

DynamicViewMode is a indicator of dynamic view mode and it is also used as the views title

const (
	// CommitStatMode when dynamic mode morphed into commit stat mode
	CommitStatMode DynamicViewMode = " Commit Stats "
	// CommitDiffMode when dynamic mode morphed into commit diff mode
	CommitDiffMode DynamicViewMode = " Diffs "
	// StashStatMode when dynamic mode morphed into stash status mode
	StashStatMode DynamicViewMode = " Stash Stats "
	// StashDiffMode when dynamic mode morphed into stash diff mode
	StashDiffMode DynamicViewMode = " Stash Diffs "
	// StatusMode when dynamic mode morphed into repository status mode
	StatusMode DynamicViewMode = " Repository Status "
	// FileDiffMode when dynamic mode morphed into file diff mode
	FileDiffMode DynamicViewMode = " File Diffs "
)

type Gui

type Gui struct {
	KeyBindings []*KeyBinding
	State       guiState
	// contains filtered or unexported fields
}

Gui struct hold the gocui struct along with the gui's state, also keybindings are tied with this struct in order to render those in different occasions

func New

func New(mode string, directories []string) (*Gui, error)

New creates a Gui object and fill it's state related entities

func (*Gui) Run

func (gui *Gui) Run() error

Run function runs the main loop with initial values

type KeyBinding

type KeyBinding struct {
	View        string
	Handler     func(*gocui.Gui, *gocui.View) error
	Key         interface{}
	Modifier    gocui.Modifier
	Display     string
	Description string
	Vital       bool
}

KeyBinding struct is helpful for not re-writing the same function over and over again. it hold useful values to generate a controls view

type Layout

type Layout int

Layout tells the gui how to order views

type ModeID

type ModeID string

ModeID is the mode indicator for the gui

type RepositoryDecorationRules

type RepositoryDecorationRules struct {
	MaxName      int
	MaxPushables int
	MaxPullables int
	MaxBranch    int
}

RepositoryDecorationRules is a rule set for creating repository labels

Jump to

Keyboard shortcuts

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