Skip to main content

SplitView

Struct SplitView 

Source
pub struct SplitView {
Show 19 fields pub key: Option<KeyRef>, pub is_pane_open: bool, pub is_pane_open_changed: SplitViewPaneChangedHandler, pub pane: Option<WidgetRef>, pub content: Option<WidgetRef>, pub display_mode: SplitViewDisplayMode, pub pane_placement: SplitViewPanePlacement, pub open_pane_length: Option<f64>, pub compact_pane_length: Option<f64>, pub light_dismiss_overlay_mode: LightDismissOverlayMode, pub pane_background: Option<Brush>, pub background: Option<Brush>, pub border_brush: Option<Brush>, pub border_thickness: Option<[f64; 4]>, pub corner_radius: Option<[f64; 4]>, pub pane_opening: Option<Listener>, pub pane_opened: Option<Listener>, pub pane_closing: Option<SplitViewPaneClosingHandler>, pub pane_closed: Option<Listener>,
}
Expand description

A container with a content area and a pane that can expand, collapse or overlay the content.

The owner supplies is_pane_open and applies requested changes. Open overlay modes require a native Overlay ancestor for dismissal outside the control. Pane and content widgets retain their state when the pane opens or closes.

Fields§

§key: Option<KeyRef>

Identifies this widget when the parent rebuilds.

§is_pane_open: bool

Whether the pane is expanded to its open width.

§is_pane_open_changed: SplitViewPaneChangedHandler

Requests a new open value from the owner after an uncanceled light dismissal.

§pane: Option<WidgetRef>

The widget displayed in the pane area; retained while the pane is closed.

§content: Option<WidgetRef>

The widget displayed in the main content area.

§display_mode: SplitViewDisplayMode

How the pane shares space with the content; defaults to Overlay.

§pane_placement: SplitViewPanePlacement

The side containing the pane; defaults to Left.

§open_pane_length: Option<f64>

The open pane width; f64::NAN sizes to the pane content, and None is the theme’s SplitViewOpenPaneThemeLength.

§compact_pane_length: Option<f64>

The width reserved by a closed compact pane; the theme’s SplitViewCompactPaneThemeLength when None.

§light_dismiss_overlay_mode: LightDismissOverlayMode

Whether the dismiss layer dims the content; defaults to desktop Auto (transparent).

§pane_background: Option<Brush>

The pane fill; None resolves the default brush from the current theme.

§background: Option<Brush>

The background behind both pane and content; None leaves it unpainted.

§border_brush: Option<Brush>

The pane border brush; the default theme brush is transparent.

§border_thickness: Option<[f64; 4]>

Pane border widths in left, top, right, bottom order; the theme’s SplitViewLeftBorderThemeThickness when None.

§corner_radius: Option<[f64; 4]>

Pane radii in top-left, top-right, bottom-right, bottom-left order; the theme’s SplitViewPaneRootCornerRadius when None.

§pane_opening: Option<Listener>

Called after the first layout of an opening transition, before focus moves into the pane.

§pane_opened: Option<Listener>

Called when the current opening transition completes.

§pane_closing: Option<SplitViewPaneClosingHandler>

Called before light dismissal, or after the first layout of an explicit closing update.

§pane_closed: Option<Listener>

Called when the current closing transition completes.

Implementations§

Source§

impl SplitView

Source

pub fn new( is_pane_open: bool, changed: impl Fn(&mut App, bool) + 'static, ) -> Self

The owner applies requested IsPaneOpen changes, as with other reveal controls.

Source

pub fn key(self, key: KeyRef) -> Self

Sets the widget identity.

Source

pub fn pane<K>(self, pane: impl IntoWidget<K>) -> Self

Sets the widget displayed in the pane area.

Source

pub fn content<K>(self, content: impl IntoWidget<K>) -> Self

Sets the widget displayed in the main content area.

Source

pub fn display_mode(self, mode: SplitViewDisplayMode) -> Self

Sets how the pane shares space with the content.

Source

pub fn pane_placement(self, placement: SplitViewPanePlacement) -> Self

Sets which side contains the pane.

Source

pub fn open_pane_length(self, length: f64) -> Self

f64::NAN is WinUI’s Auto length, measured from the pane content.

Panics for negative lengths or infinity.

Source

pub fn compact_pane_length(self, length: f64) -> Self

Sets the width reserved when a compact pane is closed.

Panics if the length is negative or non-finite.

Source

pub fn light_dismiss_overlay_mode(self, mode: LightDismissOverlayMode) -> Self

Sets the appearance of the light-dismiss layer.

Source

pub fn background(self, brush: Brush) -> Self

Sets the background behind the pane and content.

Source

pub fn corner_radius_corners(self, radius: [f64; 4]) -> Self

Sets pane radii in top-left, top-right, bottom-right, bottom-left order.

Source

pub fn pane_background(self, brush: Brush) -> Self

Sets the pane fill brush.

Source

pub fn border_brush(self, brush: Brush) -> Self

Sets the pane border brush.

Source

pub fn border_thickness(self, thickness: f64) -> Self

Sets the same pane border width on all four sides.

Source

pub fn border_thickness_ltrb(self, thickness: [f64; 4]) -> Self

Sets pane border widths in left, top, right, bottom order.

Source

pub fn corner_radius(self, radius: f64) -> Self

Sets the same radius on all four pane corners.

Source

pub fn pane_opening(self, callback: Listener) -> Self

Registers a handler for the start of an opening transition.

Source

pub fn pane_opened(self, callback: Listener) -> Self

Registers a handler for completion of an opening transition.

Source

pub fn pane_closing( self, callback: impl Fn(&mut App, &mut SplitViewPaneClosingEventArgs) + 'static, ) -> Self

Registers a handler that can cancel light dismissal through its event arguments.

Source

pub fn pane_closed(self, callback: Listener) -> Self

Registers a handler for completion of a closing transition.

Trait Implementations§

Source§

impl Clone for SplitView

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SplitView

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl StatefulWidget for SplitView

Source§

type State = SplitViewState

The state this widget creates.
Source§

fn key(&self) -> Option<&KeyRef>

Source§

fn create_state(&self) -> SplitViewState

Creates the mutable state for this widget at a given location in the tree. Read more
Source§

fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dart’s debugFillProperties: the properties a dump shows for this widget, in Dart’s order. Dart’s Widget base only sets the dense tree style, which the framework does.
Source§

fn debug_check_constructor(&self)

Source§

fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>

Source§

fn type_name(&self) -> &'static str

See Widget::type_name. A stateful form another widget kind becomes (an animated or status transition widget) names the widget it wraps.

Auto Trait Implementations§

§

impl !RefUnwindSafe for SplitView

§

impl !Send for SplitView

§

impl !Sync for SplitView

§

impl !UnwindSafe for SplitView

§

impl Forget for SplitView

§

impl Freeze for SplitView
where *const RcInner<dyn Key> is !null: Freeze, PhantomData<RcInner<dyn Key>>: Freeze, *const RcInner<dyn Fn(&mut App, bool)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, bool)>>: Freeze, *const RcInner<dyn Widget> is !null: Freeze, PhantomData<RcInner<dyn Widget>>: Freeze, *const RcInner<dyn Fn(&mut App)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze, NonZero<u32>: Freeze, *const (): Freeze, *const RcInner<dyn Fn(&mut App, &mut SplitViewPaneClosingEventArgs)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, &mut SplitViewPaneClosingEventArgs)>>: Freeze,

§

impl Move for SplitView

§

impl Unpin for SplitView
where Rc<dyn Key>: Unpin, Rc<dyn Fn(&mut App, bool)>: Unpin, Rc<dyn Widget>: Unpin, Rc<dyn Fn(&mut App)>: Unpin, NonZero<u32>: Unpin, *const (): Unpin, Rc<dyn Fn(&mut App, &mut SplitViewPaneClosingEventArgs)>: Unpin,

§

impl UnsafeUnpin for SplitView
where *const RcInner<dyn Key> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Key>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, bool)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, bool)>>: UnsafeUnpin, *const RcInner<dyn Widget> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Widget>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, *const (): UnsafeUnpin, *const RcInner<dyn Fn(&mut App, &mut SplitViewPaneClosingEventArgs)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, &mut SplitViewPaneClosingEventArgs)>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<W> IntoWidget<StatefulKind> for W
where W: StatefulWidget,

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>