pub struct PanelSpec {Show 16 fields
pub id: PanelId,
pub title: String,
pub area: Area,
pub areas: Vec<Area>,
pub commands: Vec<CommandId>,
pub min_size: f32,
pub default_size: Option<f32>,
pub detachable: bool,
pub icon: String,
pub bare: bool,
pub open: bool,
pub palette: bool,
pub floatable: bool,
pub content: Option<Mountable>,
pub kind: PanelKind,
pub instances: Instances,
}Expand description
A panel as declared: its id, title, areas, sizes, and whether it opens
once or as many times as asked (PanelSpec::instances).
Need (layout): a panel opened several times at once, each instance with its own state.
Fields§
§id: PanelId§title: String§area: AreaIts default area.
areas: Vec<Area>The areas it may be moved to besides area; empty: any area.
commands: Vec<CommandId>Command ids the panel contributes (its toggle and focus commands are added by the shell).
min_size: f32The smallest size it may be given across its area (a side bar’s width, the bottom panel’s height), in points.
default_size: Option<f32>The size it asks for across its area when it opens there.
detachable: boolWhether it may be detached into a window of its own.
icon: StringThe icon naming it in strips (an egui_pop_core::icon::Icon
name); empty: its title’s first letter.
bare: boolDrawn without a tab bar when it is alone in its area (the shell’s zones shown as panels).
open: boolPlaced in its area at first; false: closed until asked for.
palette: boolA palette: it floats over the interface when it opens (a toolbox, a navigator); it may still be docked in its areas.
floatable: boolWhether it may float over the interface: every panel may unless
it opts out (PanelSpec::floatable); a palette always may.
content: Option<Mountable>What its content needs (ADR 0013): checked against each host it
is put in. None: a plain widget, any host of a panel.
kind: PanelKindWhat it does to what the application edits (PanelKind):
a view unless declared.
instances: InstancesWhether it opens once or as many times as asked (Instances).
Implementations§
Source§impl PanelSpec
impl PanelSpec
pub fn new(id: PanelId, title: &str, area: Area) -> Self
Sourcepub fn instances(self, instances: Instances) -> Self
pub fn instances(self, instances: Instances) -> Self
Whether it opens once (the default) or as many times as asked: a
new instance is <id>#<n>, made by pop.panel.open with
instance: "new".
Sourcepub fn instance_spec(&self, id: &PanelId, title: Option<&str>) -> PanelSpec
pub fn instance_spec(&self, id: &PanelId, title: Option<&str>) -> PanelSpec
The spec of its instance id (<id>#<n>): the same panel, under
that id, titled title (else its own title and n: “Gallery 2”),
open where it is placed.
Sourcepub fn kind(self, kind: PanelKind) -> Self
pub fn kind(self, kind: PanelKind) -> Self
What it does to what the application edits: a control or mixed panel’s chrome shows an “edits” mark on its tab and its palette band.
Sourcepub fn content(self, needs: Mountable) -> Self
pub fn content(self, needs: Mountable) -> Self
What its content needs: a host refusing it refuses the panel.
Sourcepub fn default_size(self, points: f32) -> Self
pub fn default_size(self, points: f32) -> Self
The size it asks for across its area, in points.
Sourcepub fn detachable(self, on: bool) -> Self
pub fn detachable(self, on: bool) -> Self
Whether it may be detached into a window of its own.
Sourcepub fn closed(self) -> Self
pub fn closed(self) -> Self
Closed until asked for (its command, a step): a new layout and a repaired one keep it closed.
Sourcepub fn palette(self) -> Self
pub fn palette(self) -> Self
A palette: floats over the interface when it opens, never modal; its area is where it docks.
Sourcepub fn floatable(self, on: bool) -> Self
pub fn floatable(self, on: bool) -> Self
Whether it may float over the interface: on unless turned off here (a view that would leave its area empty, the centre’s document); a palette always may.
Sourcepub fn refuses(&self, host: &PanelHost) -> Option<String>
pub fn refuses(&self, host: &PanelHost) -> Option<String>
Why it may not be put in a host, if it may not: an area it stays out of, floating or a window it is not allowed, or a host its content does not fit (with the rule, ADR 0013).