Documentation
¶
Index ¶
- Constants
- Variables
- func ThemeNames() []string
- type App
- type BorderStyle
- type HelpSection
- type KeyMap
- func (k KeyMap) BranchesPanelHelp() []key.Binding
- func (k KeyMap) CommitsPanelHelp() []key.Binding
- func (k KeyMap) FilesPanelHelp() []key.Binding
- func (k KeyMap) FullHelp() []HelpSection
- func (k KeyMap) HelpViewHelp() []key.Binding
- func (k KeyMap) ShortHelp() []key.Binding
- func (k KeyMap) StashPanelHelp() []key.Binding
- type Model
- type Node
- type Palette
- type Panel
- type Theme
- type ThemeFile
- type TreeStyle
Constants ¶
const DefaultThemeName = "GitHub Dark"
DefaultThemeName is the name of the default theme.
Variables ¶
var ( ConfigDirName = ".config/gitx" ConfigFileName = "config.toml" ConfigDirPath string ConfigFilePath string ConfigThemesDirPath string )
var Palettes = map[string]Palette{
"GitHub Dark": {
Black: "#24292E",
Red: "#ff7b72",
Green: "#3fb950",
Yellow: "#d29922",
Blue: "#58a6ff",
Magenta: "#bc8cff",
Cyan: "#39c5cf",
White: "#b1bac4",
BrightBlack: "#6e7681",
BrightRed: "#ffa198",
BrightGreen: "#56d364",
BrightYellow: "#e3b341",
BrightBlue: "#79c0ff",
BrightMagenta: "#d2a8ff",
BrightCyan: "#56d4dd",
BrightWhite: "#f0f6fc",
DarkBlack: "#1b1f23",
DarkRed: "#d73a49",
DarkGreen: "#28a745",
DarkYellow: "#dbab09",
DarkBlue: "#2188ff",
DarkMagenta: "#a041f5",
DarkCyan: "#12aab5",
DarkWhite: "#8b949e",
Bg: "#0d1117",
Fg: "#c9d1d9",
},
"Gruvbox": {
Black: "#282828",
Red: "#cc241d",
Green: "#98971a",
Yellow: "#d79921",
Blue: "#458588",
Magenta: "#b16286",
Cyan: "#689d6a",
White: "#a89984",
BrightBlack: "#928374",
BrightRed: "#fb4934",
BrightGreen: "#b8bb26",
BrightYellow: "#fabd2f",
BrightBlue: "#83a598",
BrightMagenta: "#d3869b",
BrightCyan: "#8ec07c",
BrightWhite: "#ebdbb2",
DarkBlack: "#1d2021",
DarkRed: "#9d0006",
DarkGreen: "#79740e",
DarkYellow: "#b57614",
DarkBlue: "#076678",
DarkMagenta: "#8f3f71",
DarkCyan: "#427b58",
DarkWhite: "#928374",
Bg: "#282828",
Fg: "#ebdbb2",
},
}
Palettes holds all the available color palettes.
var Themes = map[string]Theme{}
Themes holds all the available themes, generated from palettes.
Functions ¶
func ThemeNames ¶
func ThemeNames() []string
ThemeNames returns a slice of the available theme names.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the main application struct.
type BorderStyle ¶
type BorderStyle struct {
Top string
Bottom string
Left string
Right string
TopLeft string
TopRight string
BottomLeft string
BottomRight string
Style lipgloss.Style
}
BorderStyle defines the characters and styles for a panel's border.
type HelpSection ¶
HelpSection is a struct to hold a title and keybindings for a help section.
type KeyMap ¶
type KeyMap struct {
// miscellaneous keybindings
Quit key.Binding
Escape key.Binding
ToggleHelp key.Binding
// keybindings for changing theme
SwitchTheme key.Binding
// keybindings for navigation
FocusNext key.Binding
FocusPrev key.Binding
FocusZero key.Binding
FocusOne key.Binding
FocusTwo key.Binding
FocusThree key.Binding
FocusFour key.Binding
FocusFive key.Binding
FocusSix key.Binding
Up key.Binding
Down key.Binding
// Keybindings for FilesPanel
StageItem key.Binding
StageAll key.Binding
Discard key.Binding
Stash key.Binding
StashAll key.Binding
Commit key.Binding
// Keybindings for BranchesPanel
Checkout key.Binding
NewBranch key.Binding
DeleteBranch key.Binding
RenameBranch key.Binding
// Keybindings for CommitsPanel
AmendCommit key.Binding
Revert key.Binding
ResetToCommit key.Binding
// Keybindings for StashPanel
StashApply key.Binding
StashPop key.Binding
StashDrop key.Binding
}
KeyMap defines the keybindings for the application.
func DefaultKeyMap ¶
func DefaultKeyMap() KeyMap
DefaultKeyMap returns a set of default keybindings.
func (KeyMap) BranchesPanelHelp ¶
BranchesPanelHelp returns a slice of key.Binding for the Branches Panel help bar.
func (KeyMap) CommitsPanelHelp ¶
CommitsPanelHelp returns a slice of key.Binding for the Commits Panel help bar.
func (KeyMap) FilesPanelHelp ¶
FilesPanelHelp returns a slice of key.Binding containing help for keybindings related to Files Panel.
func (KeyMap) FullHelp ¶
func (k KeyMap) FullHelp() []HelpSection
FullHelp returns a structured slice of HelpSection, which is used to build the full help view.
func (KeyMap) HelpViewHelp ¶
HelpViewHelp returns a slice of key.Binding containing help for keybindings related to Help View.
func (KeyMap) ShortHelp ¶
ShortHelp returns a slice of key.Binding containing help for default keybindings.
func (KeyMap) StashPanelHelp ¶
StashPanelHelp returns a slice of key.Binding for the Stash Panel help bar.
type Model ¶
type Model struct {
// New fields for command history
CommandHistory []string
// contains filtered or unexported fields
}
Model represents the state of the TUI.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents a file or directory within the file tree structure.
type Palette ¶
type Palette struct {
Black, Red, Green, Yellow, Blue, Magenta, Cyan, White,
BrightBlack, BrightRed, BrightGreen, BrightYellow, BrightBlue, BrightMagenta, BrightCyan, BrightWhite,
DarkBlack, DarkRed, DarkGreen, DarkYellow, DarkBlue, DarkMagenta, DarkCyan, DarkWhite,
Bg, Fg string
}
Palette defines a set of colors for a theme.
type Panel ¶
type Panel int
Panel is an enumeration of all the panels in the UI.
type Theme ¶
type Theme struct {
ActiveTitle lipgloss.Style
InactiveTitle lipgloss.Style
NormalText lipgloss.Style
HelpTitle lipgloss.Style
HelpKey lipgloss.Style
HelpButton lipgloss.Style
ScrollbarThumb lipgloss.Style
SelectedLine lipgloss.Style
Hyperlink lipgloss.Style
WelcomeHeading lipgloss.Style
WelcomeMsg lipgloss.Style
UserName lipgloss.Style
GitStaged lipgloss.Style
GitUnstaged lipgloss.Style
GitUntracked lipgloss.Style
GitConflicted lipgloss.Style
BranchCurrent lipgloss.Style
BranchDate lipgloss.Style
CommitSHA lipgloss.Style
CommitAuthor lipgloss.Style
CommitMerge lipgloss.Style
GraphEdge lipgloss.Style
GraphNode lipgloss.Style
GraphColors []lipgloss.Style
StashName lipgloss.Style
StashMessage lipgloss.Style
ActiveBorder BorderStyle
InactiveBorder BorderStyle
Tree TreeStyle
ErrorText lipgloss.Style
}
Theme represents the styles for different components of the UI.
func NewThemeFromPalette ¶
NewThemeFromPalette creates a Theme from a given color Palette.