summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-11-13 23:18:31 +1100
committerJesse Duffield <jessedduffield@gmail.com>2019-11-21 22:07:14 +1100
commite6be849eb2f01861ad29caa92595f32c2854bfb0 (patch)
tree3401bc68cc867a95181cc5a07702e8c518e5f33b /pkg/gui/gui.go
parent092f27495a6b362537d2f8b7ff95bf29ee21f285 (diff)
add remotes context to branches view
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index a3bcb1666..f7a6d1b68 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -107,8 +107,14 @@ type filePanelState struct {
SelectedLine int
}
+// TODO: consider splitting this out into the window and the branches view
type branchPanelState struct {
SelectedLine int
+ ContextIndex int
+}
+
+type remotePanelState struct {
+ SelectedLine int
}
type commitPanelState struct {
@@ -137,6 +143,7 @@ type statusPanelState struct {
type panelStates struct {
Files *filePanelState
Branches *branchPanelState
+ Remotes *remotePanelState
Commits *commitPanelState
Stash *stashPanelState
Menu *menuPanelState
@@ -153,6 +160,7 @@ type guiState struct {
StashEntries []*commands.StashEntry
CommitFiles []*commands.CommitFile
DiffEntries []*commands.Commit
+ Remotes []*commands.Remote
MenuItemCount int // can't store the actual list because it's of interface{} type
PreviousView string
Platform commands.Platform
@@ -183,6 +191,7 @@ func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *comma
Panels: &panelStates{
Files: &filePanelState{SelectedLine: -1},
Branches: &branchPanelState{SelectedLine: 0},
+ Remotes: &remotePanelState{SelectedLine: -1},
Commits: &commitPanelState{SelectedLine: -1},
CommitFiles: &commitFilesPanelState{SelectedLine: -1},
Stash: &stashPanelState{SelectedLine: -1},
@@ -480,6 +489,8 @@ func (gui *Gui) layout(g *gocui.Gui) error {
return err
}
branchesView.Title = gui.Tr.SLocalize("BranchesTitle")
+ branchesView.Tabs = []string{"Local Branches", "Remotes"}
+ branchesView.TabIndex = gui.State.Panels.Branches.ContextIndex
branchesView.FgColor = textColor
}