pub struct FrameSpec {Show 16 fields
pub id: FrameId,
pub kind: Kind,
pub group: Option<GroupId>,
pub title: String,
pub icon: Option<String>,
pub transient: bool,
pub visible: bool,
pub tone: Option<String>,
pub keys: Vec<(String, String)>,
pub arrangement: Option<String>,
pub show: Vec<PanelId>,
pub hide: Vec<PanelId>,
pub can_enter: Option<Guard>,
pub can_leave: Option<Guard>,
pub label: Option<Label>,
pub arrangement_for: Option<ArrangementFor>,
}Expand description
A frame as declared.
Fields§
§id: FrameId§kind: Kind§group: Option<GroupId>A mode’s group (one mode of a group at a time); none for a place.
title: StringFor the breadcrumb and the mode chips, in English; the interface
translates it through the key derived from the id,
frame-<id>.title (egui_pop_core::strings::frame_title).
icon: Option<String>An icon’s name, for the chips and crumbs (egui_pop_core::icon).
transient: boolOn the live stack, never restored.
visible: boolA mode: its group shows in the status bar, as a chip while one of its modes is on. A group is shown when any of its modes says so; a group that is pure plumbing stays out of the bar.
tone: Option<String>A mode: its chip’s tone, by the kit’s tone name (accent, info,
success, warning, danger, muted, record); accent when
none.
keys: Vec<(String, String)>Context keys the frame sets while it is on (the top place’s, every active mode’s).
arrangement: Option<String>The arrangement (a template or a saved name) the frame’s projection starts from the first time, until the user picks another there: a place’s, or a mode’s, which wins over the place’s while it is on.
show: Vec<PanelId>A mode: panels it shows while on.
hide: Vec<PanelId>A mode: panels it hides while on.
can_enter: Option<Guard>§can_leave: Option<Guard>§label: Option<Label>A place: its crumb’s label from its payload.
arrangement_for: Option<ArrangementFor>A place: the arrangement it starts from, from its payload.
Implementations§
Source§impl FrameSpec
impl FrameSpec
pub fn icon(self, icon: &str) -> Self
Sourcepub fn visible(self) -> Self
pub fn visible(self) -> Self
A mode: shows its group in the status bar (a chip while one of its modes is on).
Sourcepub fn tone(self, tone: &str) -> Self
pub fn tone(self, tone: &str) -> Self
A mode: its chip’s tone, a kit tone name (record for “an agent
is driving”).
Sourcepub fn arrangement(self, name: &str) -> Self
pub fn arrangement(self, name: &str) -> Self
The arrangement the frame’s projection starts from (a place’s, or a mode’s, which wins over the place’s while it is on).
Sourcepub fn can_enter(
self,
f: impl Fn(&GuardCall<'_>) -> Verdict + Send + Sync + 'static,
) -> Self
pub fn can_enter( self, f: impl Fn(&GuardCall<'_>) -> Verdict + Send + Sync + 'static, ) -> Self
Whether the frame may be entered.
Sourcepub fn can_leave(
self,
f: impl Fn(&GuardCall<'_>) -> Verdict + Send + Sync + 'static,
) -> Self
pub fn can_leave( self, f: impl Fn(&GuardCall<'_>) -> Verdict + Send + Sync + 'static, ) -> Self
Whether the frame may be left.
Sourcepub fn label(
self,
f: impl Fn(&LabelCall<'_>) -> Option<String> + Send + Sync + 'static,
) -> Self
pub fn label( self, f: impl Fn(&LabelCall<'_>) -> Option<String> + Send + Sync + 'static, ) -> Self
A place: its crumb’s label from its payload (a sub-workspace’s
name for {"id": "…"}), wherever the interface says the crumb
(the breadcrumb, context.read, an announcement, an undo toast).
None keeps the default: the title, and the payload when it is a
text or a number. Called while the interface draws: it must not
call back into the context stack.
Sourcepub fn arrangement_for(
self,
f: impl Fn(&Json) -> Option<String> + Send + Sync + 'static,
) -> Self
pub fn arrangement_for( self, f: impl Fn(&Json) -> Option<String> + Send + Sync + 'static, ) -> Self
A place: the arrangement (a template or a saved name) an entry
starts from, chosen from its payload; None falls back to
arrangement. Read the first time a
projection key is shown: the layout it was left with wins on
later entries.
Sourcepub fn label_of(&self, title: &str, payload: &Json) -> Option<String>
pub fn label_of(&self, title: &str, payload: &Json) -> Option<String>
The crumb label label gives for a payload, if
any.
Sourcepub fn arrangement_of(&self, payload: &Json) -> Option<String>
pub fn arrangement_of(&self, payload: &Json) -> Option<String>
The arrangement arrangement_for chooses
for a payload, if any.