notesy::status

Items of the plugin's own in the status bar, set and kept until it changes or hides them: nothing runs while they just sit there. Takes the ui permission.

rustuse notesy::{status, Color, Icon, Side};

pub fn ready() {
    let left = status::add("left");
    left.set("3 left");
    let sync = status::add("sync");
    sync.set(#{ text: "Synced", icon: Icon::Check, side: Side::Left, color: Color::Success, hint: "Up to date" });
    left.remove();
}
Function What it does
status::add(key) An item of its own, shown once it's set; returns it.
item.set(value) Shows it, or changes it. value is its text, or an object. An option it doesn't know is refused by name (a status item has no option “txt”), as adds are, rather than passed over.
item.remove() Hides it; set shows it again.

key names it: lowercase letters, digits, -, _ and ., starting with a letter.

An item object has text, and any of:

Field What it is
icon Its icon, by name.
hint Shown under the pointer; the plugin's name unless set.
command A command run when it's clicked: a command's id(), or notesy's own.
side left, after the note's name, or right (the default), before notesy's own.
order Lower comes first, left to right.
color Its text's color: a theme color's key, or one of the plugin's own.
icon_color Its icon's color, as color takes them (#rrggbb too): the sky's for a forecast, say. The bar's own otherwise.
card A view (notesy::view) shown over it while the pointer's on it, in place of its hint: a card of what it's about (a place's weather, the next hours). Only looked at: nothing in it is heard.

When the plugin stops, its items go with it.

Every page