From 9e2bc00b1556d63d1671ea91ca2c1ea2fa41ad08 Mon Sep 17 00:00:00 2001 From: Indradhanush Gupta Date: Wed, 18 Sep 2019 01:23:27 +0530 Subject: [PATCH] modules/gcal: Use colors.eventTime for timestamp of event Color of description should not change the color of event time. This commit uses the independent setting color.eventTime instead. This defaults to "white" and is consistent with the current behaviour when a value for colors.description is not set. Fixes #638 --- modules/gcal/display.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/gcal/display.go b/modules/gcal/display.go index 81aff3f7..57e7b63d 100644 --- a/modules/gcal/display.go +++ b/modules/gcal/display.go @@ -48,7 +48,7 @@ func (widget *Widget) content() (string, string, bool) { } for _, calEvent := range calEvents { - timestamp := fmt.Sprintf("[%s]%s", widget.descriptionColor(calEvent), calEvent.Timestamp()) + timestamp := fmt.Sprintf("[%s]%s", widget.eventTimeColor(calEvent), calEvent.Timestamp()) if calEvent.AllDay() { timestamp = "" } @@ -116,6 +116,10 @@ func (widget *Widget) descriptionColor(calEvent *CalEvent) string { return widget.settings.colors.description } +func (widget *Widget) eventTimeColor(calEvent *CalEvent) string { + return widget.settings.colors.eventTime +} + func (widget *Widget) eventSummary(calEvent *CalEvent, conflict bool) string { summary := calEvent.event.Summary