pub struct MacSplitView<'a> { /* private fields */ }Expand description
Authentic macOS AppKit split container (NSSplitView equivalent).
Features draggable hairline dividers, min/max pane constraints, collapse states, optional drag handle indicators, and horizontal or vertical divider orientations.
§Example
use egui_macview::{MacSplitOrientation, MacSplitView, MacTheme};
let theme = MacTheme::default();
MacSplitView::new("main_split", MacSplitOrientation::Horizontal)
.theme(&theme)
.min_first(100.0)
.show(ui,
|left_ui| { left_ui.label("Sidebar"); },
|right_ui| { right_ui.label("Detail Content"); },
);Implementations§
Source§impl<'a> MacSplitView<'a>
impl<'a> MacSplitView<'a>
Sourcepub fn new(
id_source: impl Hash + Debug,
orientation: MacSplitOrientation,
) -> Self
pub fn new( id_source: impl Hash + Debug, orientation: MacSplitOrientation, ) -> Self
Creates a split view with state tracked automatically via egui::Id.
Sourcepub fn with_pos(
id_source: impl Hash + Debug,
orientation: MacSplitOrientation,
pos: &'a mut f32,
) -> Self
pub fn with_pos( id_source: impl Hash + Debug, orientation: MacSplitOrientation, pos: &'a mut f32, ) -> Self
Creates a split view binding directly to an external &mut f32 position variable.
Sourcepub fn theme(self, theme: &'a MacTheme) -> Self
pub fn theme(self, theme: &'a MacTheme) -> Self
Injects dynamic theme to eliminate hardcoded metrics and colors.
Sourcepub fn min_second(self, min: f32) -> Self
pub fn min_second(self, min: f32) -> Self
Minimum size constraint for the second pane in points.
Sourcepub fn collapsed_first(self, collapsed: bool) -> Self
pub fn collapsed_first(self, collapsed: bool) -> Self
Collapses the first pane completely (width/height = 0).
Sourcepub fn collapsed_second(self, collapsed: bool) -> Self
pub fn collapsed_second(self, collapsed: bool) -> Self
Collapses the second pane completely (width/height = 0).
Sourcepub fn show_handle(self, show: bool) -> Self
pub fn show_handle(self, show: bool) -> Self
Controls visibility of the subtle center drag handle pill on the divider.
Sourcepub fn default_ratio(self, ratio: f32) -> Self
pub fn default_ratio(self, ratio: f32) -> Self
Default split fraction if not yet persisted.
Sourcepub fn split_panes(&mut self, ui: &mut Ui) -> (Rect, Rect)
pub fn split_panes(&mut self, ui: &mut Ui) -> (Rect, Rect)
Computes the layout geometry, handles divider drag interaction and painting,
and returns (first_rect, second_rect) for caller-managed child rendering.
Auto Trait Implementations§
impl<'a> !UnwindSafe for MacSplitView<'a>
impl<'a> Forget for MacSplitView<'a>
impl<'a> Freeze for MacSplitView<'a>
impl<'a> RefUnwindSafe for MacSplitView<'a>
impl<'a> Send for MacSplitView<'a>
impl<'a> Sync for MacSplitView<'a>
impl<'a> Unpin for MacSplitView<'a>
impl<'a> UnsafeUnpin for MacSplitView<'a>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more