pub struct InspectorLayout<'a> { /* private fields */ }Expand description
Immutable measured layout. No heap storage, model/controller or hidden reset
state. Rebuild after any model/copy/theme/bounds change; Ui::begin clears old
submissions, and Ui::cancel cancels capture when the tool closes/resets.
Implementations§
Source§impl<'a> InspectorLayout<'a>
impl<'a> InspectorLayout<'a>
Sourcepub fn new(
bounds: Rect,
fields: &'a [InspectorField<'a>],
theme: UiTheme,
) -> Result<InspectorLayout<'a>, UiError>
pub fn new( bounds: Rect, fields: &'a [InspectorField<'a>], theme: UiTheme, ) -> Result<InspectorLayout<'a>, UiError>
Validate bounded source and measure complete rows. Empty fields are valid. Duplicate IDs return DuplicateId; source limits return Capacity; invalid numeric specs, blank essential copy and impossible geometry return InvalidLayout.
pub fn bounds(&self) -> Rect
Sourcepub fn field_rect(&self, id: u64) -> Option<Rect>
pub fn field_rect(&self, id: u64) -> Option<Rect>
Complete row including its label/value/status/control rows.
Sourcepub fn control_rect(&self, id: u64) -> Option<Rect>
pub fn control_rect(&self, id: u64) -> Option<Rect>
Exact rectangle submitted to the existing button painter/hit registry.
Sourcepub fn finish<E>(
&self,
ui: &mut Ui,
enabled: bool,
validate: impl FnOnce(ValueChange) -> Result<(), E>,
) -> Result<InspectorOutcome<E>, UiError>
pub fn finish<E>( &self, ui: &mut Ui, enabled: bool, validate: impl FnOnce(ValueChange) -> Result<(), E>, ) -> Result<InspectorOutcome<E>, UiError>
Submit atomically, finish built-in input, then run a pure validator once for an actual change. All UI submission errors occur before validation.
Sourcepub fn finish_player<E>(
&self,
ui: &mut Ui,
player: &mut PlayerInput,
enabled: bool,
validate: impl FnOnce(ValueChange) -> Result<(), E>,
) -> Result<InspectorOutcome<E>, UiError>
pub fn finish_player<E>( &self, ui: &mut Ui, player: &mut PlayerInput, enabled: bool, validate: impl FnOnce(ValueChange) -> Result<(), E>, ) -> Result<InspectorOutcome<E>, UiError>
Same transaction/result contract, using existing remapped confirm and selected-pad handling. Unrelated gameplay edges remain caller/tick-owned.