mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Closes #40. Text color config into Jira widget
This commit is contained in:
parent
06702835f3
commit
0d3b663642
@ -58,12 +58,13 @@ func (widget *Widget) Refresh() {
|
|||||||
func (widget *Widget) contentFrom(searchResult *SearchResult) string {
|
func (widget *Widget) contentFrom(searchResult *SearchResult) string {
|
||||||
str := " [red]Assigned Issues[white]\n"
|
str := " [red]Assigned Issues[white]\n"
|
||||||
|
|
||||||
for _, issue := range searchResult.Issues {
|
for idx, issue := range searchResult.Issues {
|
||||||
str = str + fmt.Sprintf(
|
str = str + fmt.Sprintf(
|
||||||
" [%s]%-6s[white] [green]%-10s[white] %s\n",
|
" [%s]%-6s[white] [green]%-10s[%s] %s\n",
|
||||||
widget.issueTypeColor(&issue),
|
widget.issueTypeColor(&issue),
|
||||||
issue.IssueFields.IssueType.Name,
|
issue.IssueFields.IssueType.Name,
|
||||||
issue.Key,
|
issue.Key,
|
||||||
|
widget.rowColor(idx),
|
||||||
issue.IssueFields.Summary,
|
issue.IssueFields.Summary,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -87,3 +88,13 @@ func (widget *Widget) issueTypeColor(issue *Issue) string {
|
|||||||
|
|
||||||
return color
|
return color
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (widget *Widget) rowColor(idx int) string {
|
||||||
|
rowCol := Config.UString("wtf.mods.jira.colors.row.even", "lightblue")
|
||||||
|
|
||||||
|
if idx%2 == 0 {
|
||||||
|
rowCol = Config.UString("wtf.mods.jira.colors.row.odd", "white")
|
||||||
|
}
|
||||||
|
|
||||||
|
return rowCol
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user