summaryrefslogtreecommitdiffstats
path: root/pkg/gui/layout.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-05-13 21:10:00 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-05-13 21:24:25 +1000
commit267730bc0059eacd0327eebbaa3b9efd04ee8464 (patch)
tree33be8d44df0ad19ff38c5a8a266b761be7737cbd /pkg/gui/layout.go
parentd5db02a899540661162ca3b816cd559ff577fff2 (diff)
standardise how we handle background coloursv0.20.3
Diffstat (limited to 'pkg/gui/layout.go')
-rw-r--r--pkg/gui/layout.go14
1 files changed, 9 insertions, 5 deletions
diff --git a/pkg/gui/layout.go b/pkg/gui/layout.go
index a10d661e9..f5385e934 100644
--- a/pkg/gui/layout.go
+++ b/pkg/gui/layout.go
@@ -311,14 +311,15 @@ func (gui *Gui) layout(g *gocui.Gui) error {
branchesView.ContainsList = true
}
- if v, err := g.SetViewBeneath("commitFiles", "branches", vHeights["commits"]); err != nil {
+ commitFilesView, err := g.SetViewBeneath("commitFiles", "branches", vHeights["commits"])
+ if err != nil {
if err.Error() != "unknown view" {
return err
}
- v.Title = gui.Tr.SLocalize("CommitFiles")
- v.FgColor = textColor
- v.SetOnSelectItem(gui.onSelectItemWrapper(gui.onCommitFilesPanelSearchSelect))
- v.ContainsList = true
+ commitFilesView.Title = gui.Tr.SLocalize("CommitFiles")
+ commitFilesView.FgColor = textColor
+ commitFilesView.SetOnSelectItem(gui.onSelectItemWrapper(gui.onCommitFilesPanelSearchSelect))
+ commitFilesView.ContainsList = true
}
commitsView, err := g.SetViewBeneath("commits", "branches", vHeights["commits"])
@@ -472,6 +473,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
{view: commitsView, context: "branch-commits", selectedLine: gui.State.Panels.Commits.SelectedLine, lineCount: len(gui.State.Commits)},
{view: commitsView, context: "reflog-commits", selectedLine: gui.State.Panels.ReflogCommits.SelectedLine, lineCount: len(gui.State.FilteredReflogCommits)},
{view: stashView, context: "", selectedLine: gui.State.Panels.Stash.SelectedLine, lineCount: len(gui.State.StashEntries)},
+ {view: commitFilesView, context: "", selectedLine: gui.State.Panels.CommitFiles.SelectedLine, lineCount: len(gui.State.CommitFiles)},
}
// menu view might not exist so we check to be safe
@@ -485,6 +487,8 @@ func (gui *Gui) layout(g *gocui.Gui) error {
}
// check if the selected line is now out of view and if so refocus it
listView.view.FocusPoint(0, listView.selectedLine)
+
+ listView.view.SelBgColor = theme.GocuiSelectedLineBgColor
}
mainViewWidth, mainViewHeight := gui.getMainView().Size()