pub struct MacTabView<'a> { /* private fields */ }Expand description
Authentic macOS AppKit Tab View container (NSTabView equivalent).
Features hardware-calibrated content insets, flipped coordinate layout, animated segment transitions, and bezel border strokes.
§Example
use egui_macview::{MacAppearance, MacTabView, MacTheme};
let theme = MacTheme::new(MacAppearance::Aqua);
let mut active_tab = 0usize;
MacTabView::new(&mut active_tab)
.theme(&theme)
.tab("General", |ui| {
ui.label("General preferences");
})
.tab("Advanced", |ui| {
ui.label("Advanced settings");
})
.show(ui);Implementations§
Source§impl<'a> MacTabView<'a>
impl<'a> MacTabView<'a>
Sourcepub fn new(selected_index: &'a mut usize) -> Self
pub fn new(selected_index: &'a mut usize) -> Self
Creates a new tab view bound to an active tab selection index.
Sourcepub fn style(self, style: MacTabStyle) -> Self
pub fn style(self, style: MacTabStyle) -> Self
Sets the tab display style (TopTabsBezelBorder or NoTabsNoBorder).
Sourcepub fn control_size(self, size: MacControlSize) -> Self
pub fn control_size(self, size: MacControlSize) -> Self
Sets the control size (Regular, Small, or Mini).
Sourcepub fn tab(
self,
title: impl Into<WidgetText>,
content: impl FnOnce(&mut Ui) + 'a,
) -> Self
pub fn tab( self, title: impl Into<WidgetText>, content: impl FnOnce(&mut Ui) + 'a, ) -> Self
Appends a tab with a title and content closure.
Sourcepub fn tab_bar_height(&self) -> f32
pub fn tab_bar_height(&self) -> f32
Resolves tab bar header height in points.
Sourcepub fn content_insets(&self) -> MacInsets
pub fn content_insets(&self) -> MacInsets
Resolves exact MacBook content insets from outer container bounds.
Sourcepub fn min_container_size(&self) -> Vec2
pub fn min_container_size(&self) -> Vec2
Resolves MacBook minimum container dimensions across control sizes.
Sourcepub fn tab_bar_rect(&self, container_rect: Rect, ui: &Ui) -> Rect
pub fn tab_bar_rect(&self, container_rect: Rect, ui: &Ui) -> Rect
Computes the layout rectangle of the top segmented tab bar within a container.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for MacTabView<'a>
impl<'a> !Send for MacTabView<'a>
impl<'a> !Sync for MacTabView<'a>
impl<'a> !UnwindSafe for MacTabView<'a>
impl<'a> Forget for MacTabView<'a>
impl<'a> Freeze for MacTabView<'a>
impl<'a> Move for MacTabView<'a>
impl<'a> Unpin for MacTabView<'a>
impl<'a> UnsafeUnpin for MacTabView<'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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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