1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Merge branch 'master' into gcal-hide-declined

This commit is contained in:
Chris Cummer 2018-08-01 15:52:43 -04:00 committed by GitHub
commit 0735b95c93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 2 deletions

View File

@ -247,6 +247,10 @@ Values: A positive integer, <code>0..n</code>.</p>
Your <a href="https://developers.google.com/calendar/quickstart/go">Google client secret</a> JSON file. <br /> Your <a href="https://developers.google.com/calendar/quickstart/go">Google client secret</a> JSON file. <br />
Values: A string representing a file path to the JSON secret file.</p> Values: A string representing a file path to the JSON secret file.</p>
<p><code>showDeclined</code> <br />
Whether or not to display events you&rsquo;ve declined to attend. <br />
Values: <code>true</code>, or <code>false</code></p>
</div> </div>
<div class="footer"> <div class="footer">

View File

@ -87,7 +87,15 @@ func (widget *Widget) dayDivider(event, prevEvent *CalEvent) string {
prevStartTime = prevEvent.Start() prevStartTime = prevEvent.Start()
} }
if event.Start().Day() != prevStartTime.Day() { // round times to midnight for comparison
toMidnight := func(t time.Time) time.Time {
t = t.Local()
return time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, t.Location())
}
prevStartDay := toMidnight(prevStartTime)
eventStartDay := toMidnight(event.Start())
if !eventStartDay.Equal(prevStartDay) {
return fmt.Sprintf("[%s::b]", return fmt.Sprintf("[%s::b]",
wtf.Config.UString("wtf.mods.gcal.colors.day", "forestgreen")) + wtf.Config.UString("wtf.mods.gcal.colors.day", "forestgreen")) +

View File

@ -128,9 +128,10 @@ func (tracker *FocusTracker) focus(idx int) {
} }
view := widget.TextView() view := widget.TextView()
view.SetBorderColor(colorFor(Config.UString("wtf.colors.border.focused", "gray")))
tracker.App.SetFocus(view) tracker.App.SetFocus(view)
view.SetBorderColor(colorFor(Config.UString("wtf.colors.border.focused", "gray"))) tracker.App.Draw()
} }
func (tracker *FocusTracker) focusables() []Wtfable { func (tracker *FocusTracker) focusables() []Wtfable {