diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-19 18:41:57 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | 2f5d5034dbe4523c44faa58ba6f30c2fef06c128 (patch) | |
tree | bce2590230ef9bc560da11f376c4187c9db0067a /pkg/gui/list_context.go | |
parent | a32947e7a777cb1f1bc16ea9693bd3d01519ea4b (diff) |
good progress
Diffstat (limited to 'pkg/gui/list_context.go')
-rw-r--r-- | pkg/gui/list_context.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/pkg/gui/list_context.go b/pkg/gui/list_context.go index 9454aadf9..69ed01ef6 100644 --- a/pkg/gui/list_context.go +++ b/pkg/gui/list_context.go @@ -163,6 +163,8 @@ func (gui *Gui) menuListContext() *ListContext { GetSelectedLineIdxPtr: func() *int { return &gui.State.Panels.Menu.SelectedLine }, OnFocus: gui.handleMenuSelect, OnItemSelect: gui.handleMenuSelect, + // rendering the menu happens on creation + OnRender: func() error { return nil }, // need to add a layer of indirection here because the callback changes during runtime OnClickSelectedItem: func() error { return gui.State.Panels.Menu.OnPress(gui.g, nil) }, Gui: gui, @@ -180,6 +182,7 @@ func (gui *Gui) filesListContext() *ListContext { OnFocus: gui.focusAndSelectFile, OnItemSelect: gui.focusAndSelectFile, OnClickSelectedItem: gui.handleFilePress, + OnRender: gui.renderFiles, Gui: gui, RendersToMainView: false, Kind: SIDE_CONTEXT, @@ -194,9 +197,10 @@ func (gui *Gui) branchesListContext() *ListContext { GetSelectedLineIdxPtr: func() *int { return &gui.State.Panels.Branches.SelectedLine }, OnFocus: gui.handleBranchSelect, OnItemSelect: gui.handleBranchSelect, - Gui: gui, - RendersToMainView: true, - Kind: SIDE_CONTEXT, + OnRender: gui.renderLocalBranchesWithSelection, + Gui: gui, + RendersToMainView: true, + Kind: SIDE_CONTEXT, } } @@ -209,6 +213,7 @@ func (gui *Gui) remotesListContext() *ListContext { OnFocus: gui.renderRemotesWithSelection, OnItemSelect: gui.handleRemoteSelect, OnClickSelectedItem: gui.handleRemoteEnter, + OnRender: gui.renderRemotesWithSelection, Gui: gui, RendersToMainView: true, Kind: SIDE_CONTEXT, @@ -223,6 +228,7 @@ func (gui *Gui) remoteBranchesListContext() *ListContext { GetSelectedLineIdxPtr: func() *int { return &gui.State.Panels.RemoteBranches.SelectedLine }, OnFocus: gui.handleRemoteBranchSelect, OnItemSelect: gui.handleRemoteBranchSelect, + OnRender: gui.renderRemoteBranchesWithSelection, Gui: gui, RendersToMainView: true, Kind: SIDE_CONTEXT, @@ -237,6 +243,7 @@ func (gui *Gui) tagsListContext() *ListContext { GetSelectedLineIdxPtr: func() *int { return &gui.State.Panels.Tags.SelectedLine }, OnFocus: gui.handleTagSelect, OnItemSelect: gui.handleTagSelect, + OnRender: gui.renderTagsWithSelection, Gui: gui, RendersToMainView: true, Kind: SIDE_CONTEXT, @@ -252,6 +259,7 @@ func (gui *Gui) branchCommitsListContext() *ListContext { OnFocus: gui.handleCommitSelect, OnItemSelect: gui.handleCommitSelect, OnClickSelectedItem: gui.handleSwitchToCommitFilesPanel, + OnRender: gui.renderBranchCommitsWithSelection, Gui: gui, RendersToMainView: true, Kind: SIDE_CONTEXT, @@ -266,6 +274,7 @@ func (gui *Gui) reflogCommitsListContext() *ListContext { GetSelectedLineIdxPtr: func() *int { return &gui.State.Panels.ReflogCommits.SelectedLine }, OnFocus: gui.handleReflogCommitSelect, OnItemSelect: gui.handleReflogCommitSelect, + OnRender: gui.renderReflogCommitsWithSelection, Gui: gui, RendersToMainView: true, Kind: SIDE_CONTEXT, @@ -280,6 +289,7 @@ func (gui *Gui) stashListContext() *ListContext { GetSelectedLineIdxPtr: func() *int { return &gui.State.Panels.Stash.SelectedLine }, OnFocus: gui.handleStashEntrySelect, OnItemSelect: gui.handleStashEntrySelect, + OnRender: gui.renderStash, Gui: gui, RendersToMainView: true, Kind: SIDE_CONTEXT, @@ -294,6 +304,7 @@ func (gui *Gui) commitFilesListContext() *ListContext { GetSelectedLineIdxPtr: func() *int { return &gui.State.Panels.CommitFiles.SelectedLine }, OnFocus: gui.handleCommitFileSelect, OnItemSelect: gui.handleCommitFileSelect, + OnRender: gui.renderCommitFiles, Gui: gui, RendersToMainView: true, Kind: SIDE_CONTEXT, |