gui

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: MIT Imports: 16 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 added in v0.4.0

type DiffStatDecorationRules struct {
	MaxNameLength        int
	MaxChangeCountLength int
	MaxChangesLength     int
}

DiffStatDecorationRules is a rule set for creating diffstat text

type DiffStatItem added in v0.4.0

type DiffStatItem struct {
	FileName    string
	ChangeCount string
	Changes     string
}

DiffStatItem is a line of a diff stat

type DynamicViewMode added in v0.4.0

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 NewGui

func NewGui(mode string, directoies []string) (*Gui, error)

NewGui creates a Gui opject and fill it's state related entites

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 structs is helpful for not re-writinh the same function over and over again. it hold useful values to generate a controls view

type Layout added in v0.4.0

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 added in v0.4.0

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

RepositoryDecorationRules is a rule set for creating repositry labels

Jump to

Keyboard shortcuts

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