Module status_bubble
Expand description
A transient floating status bubble: a small floating Panel that appears when a status changes (a page turn, a zoom step, a sync that finished) or while the pointer rests on its corner, then fades away.
Transient by contract: it is shown on change and hides on its own. What a
person needs to read at any time (the cursor’s line and column, a word
count, conflict counts) is persistent status and belongs in
crate::chrome::status_bar, which reserves its band. A capture never
forces the bubble open; only a screenshot scenario that stages the change
shows it.
The bubble floats in the bottom-trailing corner of the area it reports on, one gutter in, clear of the content’s leading edge. It owns its text, its timing and its paint; the app says what changed.
Structs§
- Save
Status Surface - A document’s save status, on the framework’s status surfaces (HIG §7c):
“Saving…” and “Saved” are a change worth noticing once, so they show in
the transient
StatusBubble; a failed save is an error the person must act on, so it is an error toast (danger icon, the reason, a “Try again” action and a close button) that stays until the save succeeds or it is dismissed. An app reports the state and routes clicks; it never pins a bubble open or paints its own save pill. - Status
Bubble - Every method takes an explicit
now: Instant, so a test drives the whole show → linger → fade → hide cycle without a wall clock.
Enums§
- Save
Action - What a person did on the save status surface.
- Save
State - What a document’s save state is, as the save status surface shows it.
Constants§
- DEFAULT_
LINGER - How long the bubble lingers after a poke (or after the pointer leaves its zone) before it fades out, absent any new activity.
Functions§
- draw_
pill - Paint a bubble with
textinrect: a floating Panel (the blurred material, one soft shadow) with the label centred. For a bubble that hosts controls beside its label; a plain status usesStatusBubble::paint. - pill_
height - Height shared by layout reservations and the rendered pill: the label’s line box plus the pill’s vertical padding, never below a Small control.
- pill_
size - The pill’s size for
text.controlis a leading+trailing slot in px each for a control inside the pill (0.0for a plain label).