pub struct BubbleSpec {
pub key: Option<String>,
pub view: String,
pub wide: Option<String>,
pub payload: Value,
pub area: Area,
pub group: Option<String>,
pub order: i32,
pub priority: Priority,
pub news: bool,
pub tooltip: Option<String>,
}Expand description
Everything a module says about a bubble it wants to show.
As JSON, only view is required.
Fields§
§key: Option<String>Replaces the module’s existing bubble with the same key, keeping its place.
view: Stringmodules/<module>/<view>.qml: a small view that fits a round bubble,
an icon or a cover.
wide: Option<String>A wider view with text, shown in a pill when the user asks for it
with wide = true.
payload: ValueWhat the views get as payload.
area: AreaWhere it goes; the user’s [bubbles.<module>] settings win.
group: Option<String>Bubbles with the same group in the same area share one pill.
order: i32Lower goes further left.
priority: PriorityBreaks ties in order, decides who is left out when an area is
full, and who is in front of a stack.
news: boolShowing it again over the one with the same key is news: a stack brings it to the front for a while. A new bubble always is.
tooltip: Option<String>What the pointer resting on it shows beside it. A view can say more
with a tooltip property, worked out from its payload.
Implementations§
Source§impl BubbleSpec
impl BubbleSpec
Sourcepub fn new(view: impl Into<String>) -> Self
pub fn new(view: impl Into<String>) -> Self
A normal-priority bubble on its own, right of the center.
Sourcepub fn tooltip(self, text: impl Into<String>) -> Self
pub fn tooltip(self, text: impl Into<String>) -> Self
What the pointer resting on it shows beside it.
Sourcepub fn key(self, key: impl Into<String>) -> Self
pub fn key(self, key: impl Into<String>) -> Self
Replaces the module’s bubble with the same key in place.
Sourcepub fn wide(self, view: impl Into<String>) -> Self
pub fn wide(self, view: impl Into<String>) -> Self
The wider view with text, for users who set wide = true.
Sourcepub fn area(self, area: Area) -> Self
pub fn area(self, area: Area) -> Self
Area::CenterRight by default.
Sourcepub fn group(self, group: impl Into<String>) -> Self
pub fn group(self, group: impl Into<String>) -> Self
Bubbles with the same group next to each other share a pill.
Sourcepub fn at(self, home: &BubbleHome) -> Self
pub fn at(self, home: &BubbleHome) -> Self
Where its module’s bubbles go by default: home’s area, group and
order.
Sourcepub fn priority(self, priority: Priority) -> Self
pub fn priority(self, priority: Priority) -> Self
Breaks ties in order, picks who stays when an area is full and
who is in front of a stack.
Sourcepub fn news(self) -> Self
pub fn news(self) -> Self
Marks this showing as news: see BubbleSpec::news.
Trait Implementations§
Source§impl Clone for BubbleSpec
impl Clone for BubbleSpec
Source§fn clone(&self) -> BubbleSpec
fn clone(&self) -> BubbleSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more