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: boolWhether the pane is expanded to its open width.
is_pane_open_changed: SplitViewPaneChangedHandlerRequests 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: SplitViewDisplayModeHow the pane shares space with the content; defaults to Overlay.
pane_placement: SplitViewPanePlacementThe 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: LightDismissOverlayModeWhether 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
impl SplitView
Sourcepub fn new(
is_pane_open: bool,
changed: impl Fn(&mut App, bool) + 'static,
) -> Self
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.
Sourcepub fn pane<K>(self, pane: impl IntoWidget<K>) -> Self
pub fn pane<K>(self, pane: impl IntoWidget<K>) -> Self
Sets the widget displayed in the pane area.
Sourcepub fn content<K>(self, content: impl IntoWidget<K>) -> Self
pub fn content<K>(self, content: impl IntoWidget<K>) -> Self
Sets the widget displayed in the main content area.
Sourcepub fn display_mode(self, mode: SplitViewDisplayMode) -> Self
pub fn display_mode(self, mode: SplitViewDisplayMode) -> Self
Sets how the pane shares space with the content.
Sourcepub fn pane_placement(self, placement: SplitViewPanePlacement) -> Self
pub fn pane_placement(self, placement: SplitViewPanePlacement) -> Self
Sets which side contains the pane.
Sourcepub fn open_pane_length(self, length: f64) -> Self
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.
Sourcepub fn compact_pane_length(self, length: f64) -> Self
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.
Sourcepub fn light_dismiss_overlay_mode(self, mode: LightDismissOverlayMode) -> Self
pub fn light_dismiss_overlay_mode(self, mode: LightDismissOverlayMode) -> Self
Sets the appearance of the light-dismiss layer.
Sourcepub fn background(self, brush: Brush) -> Self
pub fn background(self, brush: Brush) -> Self
Sets the background behind the pane and content.
Sourcepub fn corner_radius_corners(self, radius: [f64; 4]) -> Self
pub fn corner_radius_corners(self, radius: [f64; 4]) -> Self
Sets pane radii in top-left, top-right, bottom-right, bottom-left order.
Sourcepub fn pane_background(self, brush: Brush) -> Self
pub fn pane_background(self, brush: Brush) -> Self
Sets the pane fill brush.
Sourcepub fn border_brush(self, brush: Brush) -> Self
pub fn border_brush(self, brush: Brush) -> Self
Sets the pane border brush.
Sourcepub fn border_thickness(self, thickness: f64) -> Self
pub fn border_thickness(self, thickness: f64) -> Self
Sets the same pane border width on all four sides.
Sourcepub fn border_thickness_ltrb(self, thickness: [f64; 4]) -> Self
pub fn border_thickness_ltrb(self, thickness: [f64; 4]) -> Self
Sets pane border widths in left, top, right, bottom order.
Sourcepub fn corner_radius(self, radius: f64) -> Self
pub fn corner_radius(self, radius: f64) -> Self
Sets the same radius on all four pane corners.
Sourcepub fn pane_opening(self, callback: Listener) -> Self
pub fn pane_opening(self, callback: Listener) -> Self
Registers a handler for the start of an opening transition.
Sourcepub fn pane_opened(self, callback: Listener) -> Self
pub fn pane_opened(self, callback: Listener) -> Self
Registers a handler for completion of an opening transition.
Sourcepub fn pane_closing(
self,
callback: impl Fn(&mut App, &mut SplitViewPaneClosingEventArgs) + 'static,
) -> Self
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.
Sourcepub fn pane_closed(self, callback: Listener) -> Self
pub fn pane_closed(self, callback: Listener) -> Self
Registers a handler for completion of a closing transition.
Trait Implementations§
Source§impl StatefulWidget for SplitView
impl StatefulWidget for SplitView
Source§type State = SplitViewState
type State = SplitViewState
Source§fn create_state(&self) -> SplitViewState
fn create_state(&self) -> SplitViewState
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
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 as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
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 SplitViewwhere
*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
impl UnsafeUnpin for SplitViewwhere
*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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.