pub struct ActivitySpec {Show 15 fields
pub key: Option<String>,
pub compact: String,
pub expanded: Option<String>,
pub expand_for: Option<Duration>,
pub payload: Value,
pub priority: Priority,
pub timeout: Option<Duration>,
pub interruptible: bool,
pub same_priority: SamePriority,
pub modal: bool,
pub overlay: Option<String>,
pub passive: bool,
pub fleeting: bool,
pub over_fullscreen: bool,
pub output: Option<String>,
}Expand description
Everything a module says about an activity it wants to show.
As JSON, only compact is required, and durations are milliseconds:
{"compact": "Timer", "timeout_ms": 4000}.
Fields§
§key: Option<String>Replaces the module’s existing activity with the same key.
compact: StringView shown by default: modules/<module>/<compact>.qml.
expanded: Option<String>View shown after a click. Without one, clicks go to the module.
expand_for: Option<Duration>Opens on the expanded view for this long, then collapses.
payload: ValueWhat the views get as payload.
priority: PriorityWho shows first, and who interrupts whom.
timeout: Option<Duration>Time on screen before the activity ends. None never times out.
interruptible: boolWhether a higher priority may interrupt it. Priority::TOP
interrupts anything.
same_priority: SamePriorityWhat it does when the shown activity has the same priority.
modal: boolTakes the keyboard while shown; a click outside the island dismisses it.
overlay: Option<String>A full-screen view under the island on every monitor.
passive: boolNever closes on a click outside, for feedback like the volume OSD that shows while the user is busy elsewhere.
fleeting: boolShown at once or not at all, never queued or suspended: feedback like the volume OSD is stale by the time it would come back.
over_fullscreen: boolShows over a fullscreen window, like a game, which hides the island otherwise. A modal activity shows there without it. For feedback on something the user just did, like a screenshot or a volume key.
output: Option<String>The monitor a modal activity shows on. The daemon picks one from
[island] panels when the module leaves it out.
Implementations§
Source§impl ActivitySpec
impl ActivitySpec
Sourcepub fn new(compact: impl Into<String>) -> ActivitySpec
pub fn new(compact: impl Into<String>) -> ActivitySpec
A normal-priority, interruptible activity with no timeout.
Sourcepub fn key(self, key: impl Into<String>) -> ActivitySpec
pub fn key(self, key: impl Into<String>) -> ActivitySpec
Replaces the module’s activity with the same key, wherever it is, instead of adding one. With the same view too, the view updates in place.
Sourcepub fn expanded(self, view: impl Into<String>) -> ActivitySpec
pub fn expanded(self, view: impl Into<String>) -> ActivitySpec
The view a click opens. Without one, clicks go to the module as
Clicked.
Sourcepub fn expand_for(self, duration: Duration) -> ActivitySpec
pub fn expand_for(self, duration: Duration) -> ActivitySpec
Opens on the expanded view, which needs one, and collapses after
duration on screen. A keyed replacement that sets it again opens it
again.
Sourcepub fn payload(self, payload: Value) -> ActivitySpec
pub fn payload(self, payload: Value) -> ActivitySpec
What the views get as payload.
Sourcepub fn priority(self, priority: Priority) -> ActivitySpec
pub fn priority(self, priority: Priority) -> ActivitySpec
See Priority; Priority::NORMAL by default.
Sourcepub fn timeout(self, timeout: Duration) -> ActivitySpec
pub fn timeout(self, timeout: Duration) -> ActivitySpec
Ends it after this long on screen. The time only runs while it’s shown, not hovered and not expanded.
Sourcepub fn uninterruptible(self) -> ActivitySpec
pub fn uninterruptible(self) -> ActivitySpec
Nothing below Priority::TOP interrupts it.
Sourcepub fn modal(self) -> ActivitySpec
pub fn modal(self) -> ActivitySpec
For views that take typing, like a launcher.
Sourcepub fn overlay(self, view: impl Into<String>) -> ActivitySpec
pub fn overlay(self, view: impl Into<String>) -> ActivitySpec
Draws view over every monitor, under the island, while the activity
shows: modules/<module>/<view>.qml, which gets the payload and its
screen. Makes the activity modal. The island waits to show the
activity until the overlay’s ready property is true, so an overlay
can capture the screen before the island changes.
Sourcepub fn passive(self) -> ActivitySpec
pub fn passive(self) -> ActivitySpec
Never closes on a click outside: see ActivitySpec::passive.
Sourcepub fn fleeting(self) -> ActivitySpec
pub fn fleeting(self) -> ActivitySpec
Never waits behind another activity: see ActivitySpec::fleeting.
Sourcepub fn over_fullscreen(self) -> ActivitySpec
pub fn over_fullscreen(self) -> ActivitySpec
Shows over a fullscreen window: see ActivitySpec::over_fullscreen.
Sourcepub fn output(self, output: impl Into<String>) -> ActivitySpec
pub fn output(self, output: impl Into<String>) -> ActivitySpec
Shows the activity on this monitor’s island only, whatever
[island] panels or notices say. Each monitor has an island of
its own, so it waits only behind what that one shows.
Sourcepub fn same_priority(self, rule: SamePriority) -> ActivitySpec
pub fn same_priority(self, rule: SamePriority) -> ActivitySpec
SamePriority::Queue by default.
Trait Implementations§
Source§impl Clone for ActivitySpec
impl Clone for ActivitySpec
Source§fn clone(&self) -> ActivitySpec
fn clone(&self) -> ActivitySpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more