MCPcopy
hub / github.com/mum4k/termdash / TimeRangePicker

Struct TimeRangePicker

widgets/timeline/timerangepicker.go:63–80  ·  view source on GitHub ↗

TimeRangePicker is a horizontal timeline scrubber widget.

Source from the content-addressed store, hash-verified

61
62// TimeRangePicker is a horizontal timeline scrubber widget.
63type TimeRangePicker struct {
64 mu sync.Mutex
65 events []Event // snapshot updated by SetPickerEvents / AddPickerEvent
66 timeMin time.Time // earliest timestamp across all events
67 timeMax time.Time // latest timestamp across all events
68 selStart time.Time
69 selEnd time.Time
70 clickCount int // 0=none 1=start set 2=range set
71 width int // canvas width captured during last Draw
72
73 // drag state
74 dragActive bool // true while ButtonLeft is held
75 dragStartX int // x-column where the drag began
76 dragCurrentX int // x-column of the latest ButtonLeft move (for ghost pin)
77
78 // onChange is called (in its own goroutine) whenever the selection changes.
79 onChange func(start, end time.Time, hasRange bool)
80}
81
82// NewTimeRangePicker creates an empty TimeRangePicker.
83//

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected