mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
WTF-730 Fix missing color key config error (#738)
* WTF-730 Fix missing color key config error Signed-off-by: Chris Cummer <chriscummer@me.com> * WTF-730 Add Subheading color formatting to modules Users can now set a `subheading` color in their config to change the color of subheadings in widget display. Defaults to `red`. Signed-off-by: Chris Cummer <chriscummer@me.com> * WTF-730 Fix oustanding color issues Clean up missing color config changes not addressed in earlier commits. Signed-off-by: Chris Cummer <chriscummer@me.com> * Remove unused dependency Signed-off-by: Chris Cummer <chriscummer@me.com> * WTF-730 Base cleanup Signed-off-by: Chris Cummer <chriscummer@me.com> * WTF-730 Fix a few bugs related to color config changes Signed-off-by: Chris Cummer <chriscummer@me.com> * WTF-730 Fix issues with PagerDuty subheading display Signed-off-by: Chris Cummer <chriscummer@me.com> * WTF-730 Fix bug with Todo list colour rendering Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
@@ -16,11 +16,15 @@ func (widget *Widget) content() (string, string, bool) {
|
||||
return widget.CommonSettings().Title, " Git repo data is unavailable ", false
|
||||
}
|
||||
|
||||
title := fmt.Sprintf("%s - [green]%s[white]", widget.CommonSettings().Title, repoData.Repository)
|
||||
title := fmt.Sprintf(
|
||||
"%s - %s[white]",
|
||||
widget.CommonSettings().Title,
|
||||
repoData.Repository,
|
||||
)
|
||||
|
||||
_, _, width, _ := widget.View.GetRect()
|
||||
str := widget.settings.common.SigilStr(len(widget.GitRepos), widget.Idx, width) + "\n"
|
||||
str += " [red]Branch[white]\n"
|
||||
str += fmt.Sprintf(" [%s]Branch[white]\n", widget.settings.common.Colors.Subheading)
|
||||
str += fmt.Sprintf(" %s", repoData.Branch)
|
||||
str += "\n"
|
||||
str += widget.formatChanges(repoData.ChangedFiles)
|
||||
@@ -31,7 +35,7 @@ func (widget *Widget) content() (string, string, bool) {
|
||||
}
|
||||
|
||||
func (widget *Widget) formatChanges(data []string) string {
|
||||
str := " [red]Changed Files[white]\n"
|
||||
str := fmt.Sprintf(" [%s]Changed Files[white]\n", widget.settings.common.Colors.Subheading)
|
||||
|
||||
if len(data) == 1 {
|
||||
str += " [grey]none[white]\n"
|
||||
@@ -68,7 +72,7 @@ func (widget *Widget) formatChange(line string) string {
|
||||
}
|
||||
|
||||
func (widget *Widget) formatCommits(data []string) string {
|
||||
str := " [red]Recent Commits[white]\n"
|
||||
str := fmt.Sprintf(" [%s]Recent Commits[white]\n", widget.settings.common.Colors.Subheading)
|
||||
|
||||
for _, line := range data {
|
||||
str += widget.formatCommit(line)
|
||||
|
||||
Reference in New Issue
Block a user