Skip to main content

BubbleSpec

Struct BubbleSpec 

Source
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: String

modules/<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: Value

What the views get as payload.

§area: Area

Where 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: i32

Lower goes further left.

§priority: Priority

Breaks ties in order, decides who is left out when an area is full, and who is in front of a stack.

§news: bool

Showing 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

Source

pub fn new(view: impl Into<String>) -> BubbleSpec

A normal-priority bubble on its own, right of the center.

Source

pub fn tooltip(self, text: impl Into<String>) -> BubbleSpec

What the pointer resting on it shows beside it.

Source

pub fn key(self, key: impl Into<String>) -> BubbleSpec

Replaces the module’s bubble with the same key in place.

Source

pub fn wide(self, view: impl Into<String>) -> BubbleSpec

The wider view with text, for users who set wide = true.

Source

pub fn payload(self, payload: Value) -> BubbleSpec

What the views get as payload.

Source

pub fn area(self, area: Area) -> BubbleSpec

Area::CenterRight by default.

Source

pub fn group(self, group: impl Into<String>) -> BubbleSpec

Bubbles with the same group next to each other share a pill.

Source

pub fn order(self, order: i32) -> BubbleSpec

Lower goes further left.

Source

pub fn at(self, home: &BubbleHome) -> BubbleSpec

Where its module’s bubbles go by default: home’s area, group and order.

Source

pub fn priority(self, priority: Priority) -> BubbleSpec

Breaks ties in order, picks who stays when an area is full and who is in front of a stack.

Source

pub fn news(self) -> BubbleSpec

Marks this showing as news: see BubbleSpec::news.

Trait Implementations§

Source§

impl Clone for BubbleSpec

Source§

fn clone(&self) -> BubbleSpec

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BubbleSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for BubbleSpec

Source§

fn default() -> BubbleSpec

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for BubbleSpec

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<BubbleSpec, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for BubbleSpec

Source§

fn eq(&self, other: &BubbleSpec) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for BubbleSpec

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for BubbleSpec

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.