notifications

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	Notifications []*Notification
	// contains filtered or unexported fields
}

func NewManager

func NewManager() *Manager

func (*Manager) AddNotification

func (m *Manager) AddNotification(announcement *models.Announcement)

func (*Manager) RenderLoop

func (m *Manager) RenderLoop(ctx *nanovgo.Context)

RenderLoop loops through our current notifications to see if there are any which we should call rendering methods on.

func (*Manager) UpdateAttributes

func (m *Manager) UpdateAttributes(settings *models.PresentationSettings, cluster *models.ScreenCluster, screen *models.Screen)

UpdateAttributes is used to update the attributes needed during rendering. TODO: We should come up with a better way to do this.

type Notification

type Notification struct {
	HasCompleted bool
	// contains filtered or unexported fields
}

func (*Notification) Render

func (n *Notification) Render(ctx *nanovgo.Context)

Render actually renders the notification to the GUI context. `ShouldRender` should be run before this to ensure the rendering method should be called on this notification.

func (*Notification) ShouldRender

func (n *Notification) ShouldRender() bool

ShouldRender checks to see if this notification should be rendered. If it's past the given lifespan then we set it to completed, so we can garbage collect it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL