Reset#
func (intent *HoverIntent) Reset()Reset forgets the current candidate, as leaving the control does.
type HoverIntent struct {
// contains filtered or unexported fields
}HoverIntent is caller-owned hover-rest state for a control that opens something on hover, such as a hover card, a submenu trigger, a menubar trigger while another menu is open, or a navigation menu. Its zero value is ready for the first target. Call Rest with the hovered identity each frame: it returns the identity once it has rested for delay, and otherwise how long the caller should wait before asking again. Moving to another target, or passing zero, starts over, so the caller schedules no timer of its own.
Reset#func (intent *HoverIntent) Reset()Reset forgets the current candidate, as leaving the control does.
Rest#func (intent *HoverIntent) Rest(target ui.ID, now time.Time, delay time.Duration) (ui.ID, time.Duration)Rest advances the intent to target at now. It returns target and zero once the target has rested for delay; until then it returns zero and the remaining wait. A zero target clears the candidate. A non-positive delay makes the target ready at once.