diff options
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/layout.go | 14 | ||||
-rw-r--r-- | pkg/gui/merge_panel.go | 1 | ||||
-rw-r--r-- | pkg/gui/presentation/files.go | 21 |
3 files changed, 27 insertions, 9 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() diff --git a/pkg/gui/merge_panel.go b/pkg/gui/merge_panel.go index 4d9a258fc..d30f152ac 100644 --- a/pkg/gui/merge_panel.go +++ b/pkg/gui/merge_panel.go @@ -59,6 +59,7 @@ func (gui *Gui) coloredConflictFile(content string, conflicts []commands.Conflic colour := color.New(colourAttr) if hasFocus && conflictIndex < len(conflicts) && conflicts[conflictIndex] == conflict && gui.shouldHighlightLine(i, conflict, conflictTop) { colour.Add(color.Bold) + colour.Add(theme.SelectedLineBgColor) } if i == conflict.End && len(remainingConflicts) > 0 { conflict, remainingConflicts = gui.shiftConflict(remainingConflicts) diff --git a/pkg/gui/presentation/files.go b/pkg/gui/presentation/files.go index 3e70617fa..a16abdce6 100644 --- a/pkg/gui/presentation/files.go +++ b/pkg/gui/presentation/files.go @@ -28,9 +28,6 @@ func getFileDisplayStrings(f *commands.File, diffed bool) []string { return []string{red.Sprint(f.DisplayString)} } - output := green.Sprint(f.DisplayString[0:1]) - output += red.Sprint(f.DisplayString[1:3]) - var restColor *color.Color if diffed { restColor = diffColor @@ -39,6 +36,22 @@ func getFileDisplayStrings(f *commands.File, diffed bool) []string { } else { restColor = green } - output += restColor.Sprint(f.Name) + + // this is just making things look nice when the background attribute is 'reverse' + firstChar := f.DisplayString[0:1] + firstCharCl := green + if firstChar == " " { + firstCharCl = restColor + } + + secondChar := f.DisplayString[1:2] + secondCharCl := red + if secondChar == " " { + secondCharCl = restColor + } + + output := firstCharCl.Sprint(firstChar) + output += secondCharCl.Sprint(secondChar) + output += restColor.Sprintf(" %s", f.Name) return []string{output} } |