pub struct CollapsiblePanelState {
pub side: DockSide,
pub open: bool,
pub open_t: f32,
pub size_px: f32,
pub min_size_px: f32,
pub max_size_px: f32,
pub separator_px: f32,
/* private fields */
}Expand description
State for a single side-docked, collapsible panel.
Wrapped in Rc<RefCell<_>> and remembered by the caller; the slide
animation is advanced inside CollapsibleSidePanel each frame.
Fields§
§side: DockSide§open: boolLogical open/closed flag (drives the animation target).
open_t: f32Animated openness, 0..1 (1 = fully open). Follows the pointer while an edge drag is in progress.
size_px: f32Width (Left/Right) or height (Top/Bottom) of the open panel body, in dp.
min_size_px: f32§max_size_px: f32§separator_px: f32Thickness of the draggable separator edge, in dp.
Implementations§
Source§impl CollapsiblePanelState
impl CollapsiblePanelState
pub fn new(side: DockSide, size_px: f32) -> Self
pub fn toggle(&mut self)
Sourcepub fn visible_body_size(&self) -> f32
pub fn visible_body_size(&self) -> f32
Visible body size (excluding the separator), honoring an active drag.
Sourcepub fn visible_total(&self) -> f32
pub fn visible_total(&self) -> f32
Total extent of the panel slot, including the separator hit strip.
Sourcepub fn advance(&mut self) -> bool
pub fn advance(&mut self) -> bool
Advance the slide animation toward the logical open target.
Returns true if still animating (caller should request_frame).
pub fn begin_edge_drag(&mut self, pointer_along_axis: f32)
Sourcepub fn edge_drag(&mut self, pointer_along_axis: f32)
pub fn edge_drag(&mut self, pointer_along_axis: f32)
Update the drag from the current pointer position along the panel axis.
Sourcepub fn end_edge_drag(&mut self)
pub fn end_edge_drag(&mut self)
End the drag: snap open/closed. A partially-open pull snaps to the nearest state and animates there on subsequent frames.