Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/gcal/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (widget *Widget) content() (string, string, bool) {
return title, widget.err.Error(), true
}

if (calEvents == nil) || (len(calEvents) == 0) {
if len(calEvents) == 0 {
return title, "No calendar events", false
}

Expand Down
8 changes: 6 additions & 2 deletions modules/todo/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ func (widget *Widget) RowColor(idx int, hidden int, checked bool) string {
}

if checked {
return widget.settings.Colors.Checked
return fmt.Sprintf(
"%s:%s",
widget.settings.Colors.Checked,
widget.CommonSettings().Colors.Background,
)
} else {
return widget.CommonSettings().RowColor(idx - hidden)
}
Expand All @@ -133,7 +137,7 @@ func (widget *Widget) formattedItemLine(idx int, hidden int, currItem *checklist

todoDate := currItem.Date
row := fmt.Sprintf(
` [%s]|%s| `,
`[%s] |%s| `,
rowColor,
currItem.CheckMark(),
)
Expand Down
14 changes: 7 additions & 7 deletions modules/uptimekuma/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ func (widget *Widget) content() string {
if statusCounts[DOWN] == 0 {
downColor = "green"
}
builder.WriteString(fmt.Sprintf("[%s] Up: [green]%d", textColor, statusCounts[UP]))
builder.WriteString(fmt.Sprintf("[%s] (%.1f%%)", textColor, avgUptime))
builder.WriteString(fmt.Sprintf("[%s], Down: [%s]%d", textColor, downColor, statusCounts[DOWN]))
fmt.Fprintf(&builder, "[%s] Up: [green]%d", textColor, statusCounts[UP])
fmt.Fprintf(&builder, "[%s] (%.1f%%)", textColor, avgUptime)
fmt.Fprintf(&builder, "[%s], Down: [%s]%d", textColor, downColor, statusCounts[DOWN])
if statusCounts[MAINTENANCE] > 0 {
builder.WriteString(fmt.Sprintf("[%s], Maint: [%s]%d", textColor, "blue", statusCounts[MAINTENANCE]))
fmt.Fprintf(&builder, "[%s], Maint: [%s]%d", textColor, "blue", statusCounts[MAINTENANCE])
}
if statusCounts[PENDING] > 0 {
builder.WriteString(fmt.Sprintf("[%s], Pend: [%s]%d", textColor, "orange", statusCounts[PENDING]))
fmt.Fprintf(&builder, "[%s], Pend: [%s]%d", textColor, "orange", statusCounts[PENDING])
}

if widget.statusData.Incident != nil {
Expand All @@ -157,9 +157,9 @@ func (widget *Widget) content() string {
created, err := time.Parse(layout, widget.statusData.Incident.CreatedDate)
if err == nil {
hoursAgo := time.Since(created).Hours()
builder.WriteString(fmt.Sprintf("[%s]\n Incident: %.0fh ago", textColor, hoursAgo))
fmt.Fprintf(&builder, "[%s]\n Incident: %.0fh ago", textColor, hoursAgo)
} else {
builder.WriteString(fmt.Sprintf("[%s]\n Incident [unparsable date]", textColor))
fmt.Fprintf(&builder, "[%s]\n Incident [unparsable date]", textColor)
}
}

Expand Down
19 changes: 9 additions & 10 deletions view/bargraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,15 @@ func BuildStars(data []Bar, maxStars int, starChar string) string {
}

//write the line
_, err := buffer.WriteString(
fmt.Sprintf(
"%s%s[[%s]%s[default]%s] %s\n",
bar.Label,
strings.Repeat(" ", longestLabel-len(bar.Label)),
labelColor,
strings.Repeat(starChar, starCount),
strings.Repeat(" ", maxStars-starCount),
label,
),
_, err := fmt.Fprintf(
&buffer,
"%s%s[[%s]%s[default]%s] %s\n",
bar.Label,
strings.Repeat(" ", longestLabel-len(bar.Label)),
labelColor,
strings.Repeat(starChar, starCount),
strings.Repeat(" ", maxStars-starCount),
label,
)
if err != nil {
return ""
Expand Down
Loading