pub struct Splitter<D, W>where
D: Directional,
W: Widget,{ /* private fields */ }
Expand description
A resizable row/column widget
Similar to crate::List
but with draggable handles between items.
Implementations§
source§impl<D, W> Splitter<D, W>where
D: Directional,
W: Widget,
impl<D, W> Splitter<D, W>where D: Directional, W: Widget,
sourcepub fn new_with_direction(
direction: D,
widgets: Vec<W, Global>
) -> Splitter<D, W>
pub fn new_with_direction( direction: D, widgets: Vec<W, Global> ) -> Splitter<D, W>
Construct a new instance with explicit direction
sourcepub fn edit<F>(&mut self, f: F) -> Actionwhere
F: FnOnce(&mut Vec<W, Global>),
pub fn edit<F>(&mut self, f: F) -> Actionwhere F: FnOnce(&mut Vec<W, Global>),
Edit the list of children directly
This may be used to edit children before window construction. It may
also be used from a running UI, but in this case a full reconfigure
of the window’s widgets is required (triggered by the the return
value, Action::RECONFIGURE
).
sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut W>
pub fn get_mut(&mut self, index: usize) -> Option<&mut W>
Returns a mutable reference to the child, if any
sourcepub fn push(&mut self, mgr: &mut ConfigMgr<'_>, widget: W) -> usize
pub fn push(&mut self, mgr: &mut ConfigMgr<'_>, widget: W) -> usize
Append a child widget
The new child is configured immediately. Action::RESIZE
is
triggered.
Returns the new element’s index.
sourcepub fn pop(&mut self, mgr: &mut ConfigMgr<'_>) -> Option<W>
pub fn pop(&mut self, mgr: &mut ConfigMgr<'_>) -> Option<W>
Remove the last child widget (if any) and return
Triggers Action::RESIZE
.
sourcepub fn insert(&mut self, mgr: &mut ConfigMgr<'_>, index: usize, widget: W)
pub fn insert(&mut self, mgr: &mut ConfigMgr<'_>, index: usize, widget: W)
Inserts a child widget position index
Panics if index > len
.
The new child is configured immediately. Triggers Action::RESIZE
.
sourcepub fn remove(&mut self, mgr: &mut ConfigMgr<'_>, index: usize) -> W
pub fn remove(&mut self, mgr: &mut ConfigMgr<'_>, index: usize) -> W
Removes the child widget at position index
Panics if index
is out of bounds.
Triggers Action::RESIZE
.
sourcepub fn replace(&mut self, mgr: &mut ConfigMgr<'_>, index: usize, w: W) -> W
pub fn replace(&mut self, mgr: &mut ConfigMgr<'_>, index: usize, w: W) -> W
Replace the child at index
Panics if index
is out of bounds.
The new child is configured immediately. Triggers Action::RESIZE
.
Trait Implementations§
source§impl<D, W> Layout for Splitter<D, W>where
D: Directional,
W: Widget,
impl<D, W> Layout for Splitter<D, W>where D: Directional, W: Widget,
source§impl<D, W> Widget for Splitter<D, W>where
D: Directional,
W: Widget,
impl<D, W> Widget for Splitter<D, W>where D: Directional, W: Widget,
source§fn handle_message(&mut self, mgr: &mut EventMgr<'_>)
fn handle_message(&mut self, mgr: &mut EventMgr<'_>)
source§fn translation(&self) -> Offset
fn translation(&self) -> Offset
source§fn steal_event(
&mut self,
mgr: &mut EventMgr<'_>,
id: &WidgetId,
event: &Event
) -> Response
fn steal_event( &mut self, mgr: &mut EventMgr<'_>, id: &WidgetId, event: &Event ) -> Response
source§impl<D, W> WidgetChildren for Splitter<D, W>where
D: Directional,
W: Widget,
impl<D, W> WidgetChildren for Splitter<D, W>where D: Directional, W: Widget,
source§fn num_children(&self) -> usize
fn num_children(&self) -> usize
source§fn get_child(&self, index: usize) -> Option<&dyn Widget>
fn get_child(&self, index: usize) -> Option<&dyn Widget>
None
if the index is
out of bounds. Read moresource§fn get_child_mut(&mut self, index: usize) -> Option<&mut dyn Widget>
fn get_child_mut(&mut self, index: usize) -> Option<&mut dyn Widget>
source§impl<D, W> WidgetCore for Splitter<D, W>where
D: Directional,
W: Widget,
impl<D, W> WidgetCore for Splitter<D, W>where D: Directional, W: Widget,
source§fn widget_name(&self) -> &'static str
fn widget_name(&self) -> &'static str
source§fn as_widget_mut(&mut self) -> &mut dyn Widget
fn as_widget_mut(&mut self) -> &mut dyn Widget
Auto Trait Implementations§
impl<D, W> RefUnwindSafe for Splitter<D, W>where D: RefUnwindSafe, W: RefUnwindSafe,
impl<D, W> !Send for Splitter<D, W>
impl<D, W> !Sync for Splitter<D, W>
impl<D, W> Unpin for Splitter<D, W>where D: Unpin, W: Unpin,
impl<D, W> UnwindSafe for Splitter<D, W>where D: UnwindSafe, W: UnwindSafe,
Blanket Implementations§
source§impl<W> AdaptWidget for Wwhere
W: Widget + ?Sized,
impl<W> AdaptWidget for Wwhere W: Widget + ?Sized,
source§fn map_msg<M, N, F>(self, f: F) -> MapMessage<Self, M, N, F>where
M: Debug,
N: Debug,
Self: Sized,
F: FnMut(M) -> N,
fn map_msg<M, N, F>(self, f: F) -> MapMessage<Self, M, N, F>where M: Debug, N: Debug, Self: Sized, F: FnMut(M) -> N,
source§fn with_reserve<R>(self, r: R) -> Reserve<Self, R>where
R: FnMut(SizeMgr<'_>, AxisInfo) -> SizeRules,
Self: Sized,
fn with_reserve<R>(self, r: R) -> Reserve<Self, R>where R: FnMut(SizeMgr<'_>, AxisInfo) -> SizeRules, Self: Sized,
source§fn with_min_size_px(self, w: i32, h: i32) -> Reserve<Self, WithMinSizePx>where
Self: Sized,
fn with_min_size_px(self, w: i32, h: i32) -> Reserve<Self, WithMinSizePx>where Self: Sized,
source§fn with_min_size_em(self, w: f32, h: f32) -> Reserve<Self, WithMinSizeEm>where
Self: Sized,
fn with_min_size_em(self, w: f32, h: f32) -> Reserve<Self, WithMinSizeEm>where Self: Sized,
source§fn with_label<D, T>(self, direction: D, label: T) -> WithLabel<Self, D>where
D: Directional,
T: Into<AccelString>,
Self: Sized,
fn with_label<D, T>(self, direction: D, label: T) -> WithLabel<Self, D>where D: Directional, T: Into<AccelString>, Self: Sized,
§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere T: ConvApprox<S>,
§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
§fn cast_approx(self) -> T
fn cast_approx(self) -> T
§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere T: ConvFloat<S>,
§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
§fn cast_floor(self) -> T
fn cast_floor(self) -> T
§fn try_cast_trunc(self) -> Result<T, Error>
fn try_cast_trunc(self) -> Result<T, Error>
§fn try_cast_nearest(self) -> Result<T, Error>
fn try_cast_nearest(self) -> Result<T, Error>
§fn try_cast_floor(self) -> Result<T, Error>
fn try_cast_floor(self) -> Result<T, Error>
§fn try_cast_ceil(self) -> Result<T, Error>
fn try_cast_ceil(self) -> Result<T, Error>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for Pwhere
R: Read + ReadEndian<P>,
P: Default,
impl<R, P> ReadPrimitive<R> for Pwhere R: Read + ReadEndian<P>, P: Default,
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.source§impl<W> WidgetExt for Wwhere
W: Widget + ?Sized,
impl<W> WidgetExt for Wwhere W: Widget + ?Sized,
source§fn eq_id<T>(&self, rhs: T) -> boolwhere
WidgetId: PartialEq<T>,
fn eq_id<T>(&self, rhs: T) -> boolwhere WidgetId: PartialEq<T>,
source§fn identify(&self) -> IdentifyWidget
fn identify(&self) -> IdentifyWidget
source§fn is_ancestor_of(&self, id: &WidgetId) -> bool
fn is_ancestor_of(&self, id: &WidgetId) -> bool
id
is self or a descendant Read moresource§fn is_strict_ancestor_of(&self, id: &WidgetId) -> bool
fn is_strict_ancestor_of(&self, id: &WidgetId) -> bool
id
is not self and is a descendant Read more