Brian Buller
23b8a190ec
* Can toggle default calendars * Though the interactive screen doesn't update :( * Colorize default view depending on time until event
24 lines
398 B
Go
24 lines
398 B
Go
package main
|
|
|
|
import "github.com/jroimartin/gocui"
|
|
|
|
type screen interface {
|
|
setViewDefaults(*gocui.View)
|
|
setViewTextAndCursor(*gocui.View, string)
|
|
getViewValue(*gocui.Gui)
|
|
}
|
|
|
|
type position struct {
|
|
// value = pct * MAX + abs
|
|
pct float32
|
|
abs int
|
|
}
|
|
|
|
func (p position) getCoordinate(max int) int {
|
|
return int(p.pct*float32(max)) + p.abs
|
|
}
|
|
|
|
type viewPosition struct {
|
|
x0, y0, x1, y1 position
|
|
}
|