diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-08-01 16:02:49 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-08-01 16:14:56 +1000 |
commit | d626bcac0029267d3f45223198902f5cb78d9dc1 (patch) | |
tree | 684b0bd2cb23d4fac8dc7a53a28e2fd83c314abd /pkg/gui/presentation | |
parent | 123d624141ca73b828bdd6c6b43ff16ce1ec0e49 (diff) |
color fixups
Diffstat (limited to 'pkg/gui/presentation')
-rw-r--r-- | pkg/gui/presentation/branches.go | 10 | ||||
-rw-r--r-- | pkg/gui/presentation/commits.go | 2 | ||||
-rw-r--r-- | pkg/gui/presentation/remote_branches.go | 6 | ||||
-rw-r--r-- | pkg/gui/presentation/remotes.go | 6 | ||||
-rw-r--r-- | pkg/gui/presentation/stash_entries.go | 6 | ||||
-rw-r--r-- | pkg/gui/presentation/tags.go | 6 |
6 files changed, 18 insertions, 18 deletions
diff --git a/pkg/gui/presentation/branches.go b/pkg/gui/presentation/branches.go index 548bd143c..9b35b5c3c 100644 --- a/pkg/gui/presentation/branches.go +++ b/pkg/gui/presentation/branches.go @@ -27,11 +27,11 @@ func getBranchDisplayStrings(b *models.Branch, fullDescription bool, diffed bool displayName = b.DisplayName } - nameColorAttr := GetBranchColor(b.Name) + nameTextStyle := GetBranchTextStyle(b.Name) if diffed { - nameColorAttr = theme.DiffTerminalColor + nameTextStyle = theme.DiffTerminalColor } - coloredName := nameColorAttr.Sprint(displayName) + coloredName := nameTextStyle.Sprint(displayName) if b.IsTrackingRemote() { coloredName = fmt.Sprintf("%s %s", coloredName, ColoredBranchStatus(b)) } @@ -48,8 +48,8 @@ func getBranchDisplayStrings(b *models.Branch, fullDescription bool, diffed bool return res } -// GetBranchColor branch color -func GetBranchColor(name string) style.TextStyle { +// GetBranchTextStyle branch color +func GetBranchTextStyle(name string) style.TextStyle { branchType := strings.Split(name, "/")[0] switch branchType { diff --git a/pkg/gui/presentation/commits.go b/pkg/gui/presentation/commits.go index 5823a7153..0743fd14e 100644 --- a/pkg/gui/presentation/commits.go +++ b/pkg/gui/presentation/commits.go @@ -59,7 +59,7 @@ func getFullDescriptionDisplayStringsForCommit(c *models.Commit, cherryPickedCom if c.Action != "" { secondColumnString = actionColorMap(c.Action).Sprint(c.Action) } else if c.ExtraInfo != "" { - tagString = theme.DiffTerminalColor.SetBold().Sprint(c.ExtraInfo) + " " + tagString = style.FgMagenta.SetBold().Sprint(c.ExtraInfo) + " " } truncatedAuthor := utils.TruncateWithEllipsis(c.Author, 17) diff --git a/pkg/gui/presentation/remote_branches.go b/pkg/gui/presentation/remote_branches.go index 3c36a9e84..d8439acfe 100644 --- a/pkg/gui/presentation/remote_branches.go +++ b/pkg/gui/presentation/remote_branches.go @@ -18,10 +18,10 @@ func GetRemoteBranchListDisplayStrings(branches []*models.RemoteBranch, diffName // getRemoteBranchDisplayStrings returns the display string of branch func getRemoteBranchDisplayStrings(b *models.RemoteBranch, diffed bool) []string { - nameColorAttr := GetBranchColor(b.Name) + textStyle := GetBranchTextStyle(b.Name) if diffed { - nameColorAttr = theme.DiffTerminalColor + textStyle = theme.DiffTerminalColor } - return []string{nameColorAttr.Sprint(b.Name)} + return []string{textStyle.Sprint(b.Name)} } diff --git a/pkg/gui/presentation/remotes.go b/pkg/gui/presentation/remotes.go index 6c094ecfd..a1e50fe2f 100644 --- a/pkg/gui/presentation/remotes.go +++ b/pkg/gui/presentation/remotes.go @@ -21,10 +21,10 @@ func GetRemoteListDisplayStrings(remotes []*models.Remote, diffName string) [][] func getRemoteDisplayStrings(r *models.Remote, diffed bool) []string { branchCount := len(r.Branches) - nameColorAttr := theme.DefaultTextColor + textStyle := theme.DefaultTextColor if diffed { - nameColorAttr = theme.DiffTerminalColor + textStyle = theme.DiffTerminalColor } - return []string{nameColorAttr.Sprint(r.Name), style.FgBlue.Sprintf("%d branches", branchCount)} + return []string{textStyle.Sprint(r.Name), style.FgBlue.Sprintf("%d branches", branchCount)} } diff --git a/pkg/gui/presentation/stash_entries.go b/pkg/gui/presentation/stash_entries.go index 8ba6d5afb..f15b35a9c 100644 --- a/pkg/gui/presentation/stash_entries.go +++ b/pkg/gui/presentation/stash_entries.go @@ -18,9 +18,9 @@ func GetStashEntryListDisplayStrings(stashEntries []*models.StashEntry, diffName // getStashEntryDisplayStrings returns the display string of branch func getStashEntryDisplayStrings(s *models.StashEntry, diffed bool) []string { - attr := theme.DefaultTextColor + textStyle := theme.DefaultTextColor if diffed { - attr = theme.DiffTerminalColor + textStyle = theme.DiffTerminalColor } - return []string{attr.Sprint(s.Name)} + return []string{textStyle.Sprint(s.Name)} } diff --git a/pkg/gui/presentation/tags.go b/pkg/gui/presentation/tags.go index 529e34608..4754c4bef 100644 --- a/pkg/gui/presentation/tags.go +++ b/pkg/gui/presentation/tags.go @@ -18,9 +18,9 @@ func GetTagListDisplayStrings(tags []*models.Tag, diffName string) [][]string { // getTagDisplayStrings returns the display string of branch func getTagDisplayStrings(t *models.Tag, diffed bool) []string { - attr := theme.DefaultTextColor + textStyle := theme.DefaultTextColor if diffed { - attr = theme.DiffTerminalColor + textStyle = theme.DiffTerminalColor } - return []string{attr.Sprint(t.Name)} + return []string{textStyle.Sprint(t.Name)} } |