Skip to main content

Module reaction_strip

Module reaction_strip 

Expand description

The reaction strip: one pill per emoji people reacted with, its count beside it, and a trailing button to add one.

Everything that takes reactions ([tilo_resource::Reactions]) shows them with this strip, so a reaction reads the same under a chat message, on a page and in a window’s toolbar. Your own reaction is the chosen pill (the accent washed in, with an accent edge); a workspace emoji (:name:) is drawn as its picture from crate::workspace_emoji and as its :name: while the picture is not there. Pointing at a pill names who reacted. A pill arriving appears from its centre and a count changing cross-fades (motion::Appear, motion::CrossFade), both only once the strip is on screen and as reduced motion allows.

Two ways in: by hand, ReactionStrip keeps one strip’s motion and lays the pills out from an origin within a width (ReactionStrip::layout, then ReactionStrip::paint, hit, tooltip_at, accessibility; measure_height sizes a row first); retained, ReactionStripWidget places like any widget, reports a toggle as ReactionToggle and opens the shared emoji picker from its add button.

Structs§

ReactionStrip
One strip’s pills and how they move: what a host keeps per strip it paints (a message’s reactions), so a reaction arriving appears and a count changing cross-fades.
ReactionStripWidget
The reactions to one thing, as a widget: pills that toggle your own reaction, and an add button that asks for another emoji.
ReactionToggle
A person reacting with an emoji (react), or taking their reaction back: what a pill or a pick in the picker asks for.
StripLayout
The pills and the add button of one strip, laid out.
StripMetrics
A strip’s geometry in one theme: everything the text scale moves.
StripPill
One laid-out pill.

Enums§

StripHit
What a point on the strip is.

Functions§

layout
Lay out groups from origin, wrapping at max_width: one pill per group, then the add button when can_react.
measure_height
How tall the strip of groups is within max_width: nothing when there is nothing to show.
paint_emoji
Draw emoji in rect: a workspace emoji’s picture, its :name: in style and ink while it has none, or the Unicode emoji centred and sized to the rect.
pill_count
A pill’s accessible value: how many reacted with its emoji.
pill_name
A pill’s accessible name: what pressing it does.