LavaUI docs

class Notifications

Swift

final class Notifications

Desktop notifications, from the panel's side: what is on screen right now, and what a click on it does.

The Swift half of canvas's NotificationHost, and the same shape as StatusNotifierTray — poll on the frame loop, rebuild when the revision moves, forward the user's decisions back out. Everything that speaks D-Bus stays on the C++ side; everything that decides what a toast looks like stays above this.

Sources/LavaUI/Notifications.swift:13

Constructors

init(editor: Editor)

Not documented.

Sources/LavaUI/Notifications.swift:63

Properties

var isServing: Bool { get set }

Whether this panel is the session's notification daemon. False when something else already owns the name — dunst, or the desktop this is nested inside — in which case that daemon draws them and this shows nothing.

Sources/LavaUI/Notifications.swift:60

var toasts: [Toast] { get set }

Not documented.

Sources/LavaUI/Notifications.swift:61

Methods

func activate(_ toast: Toast)

A click on the body: the default action if the sender offered one, and otherwise just gone.

Sources/LavaUI/Notifications.swift:88

func dismiss(_ toast: Toast)

Not documented.

Sources/LavaUI/Notifications.swift:100

func dismissAll()

Not documented.

Sources/LavaUI/Notifications.swift:104

func invoke(_ toast: Toast, action: Toast.Action)

Not documented.

Sources/LavaUI/Notifications.swift:96

@discardableResult func poll() -> Bool

Pumps the bus, retires what expired, and rebuilds when either changed.

Sources/LavaUI/Notifications.swift:76

func setPaused(_ paused: Bool)

Stops every countdown while the pointer is over the stack. A notification that vanishes mid-sentence is one the user has to guess at.

Sources/LavaUI/Notifications.swift:110

Types