pub struct TabsLayout {
pub tab_rects: Vec<(String, Rect, Rect)>,
pub controls: TabsControls,
}Expand description
Hit geometry returned alongside tab-bar draw commands.
Each tab tuple contains (owned_id, whole_tab_rect, close_rect) in visible
input order. Tabs that do not fit are absent.
§Examples
use ailloli_ui_core::Rect;
use ailloli_ui_widgets::controls::tabs::{TabsControls, TabsLayout};
let layout = TabsLayout {
tab_rects: vec![("one".into(), Rect::new(0.0, 0.0, 120.0, 28.0), Rect::new(98.0, 0.0, 22.0, 28.0))],
controls: TabsControls {
new_tab_rect: Rect::new(0.0, 0.0, 0.0, 0.0),
history_rect: Rect::new(0.0, 0.0, 0.0, 0.0),
can_create_path_tab: false,
},
};
assert_eq!(layout.tab_rects[0].0, "one");Fields§
§tab_rects: Vec<(String, Rect, Rect)>Visible tab identities and their tab/close hit rectangles.
controls: TabsControlsTrailing-control geometry and caller-supplied capability flag.
Trait Implementations§
Source§impl Clone for TabsLayout
impl Clone for TabsLayout
Source§fn clone(&self) -> TabsLayout
fn clone(&self) -> TabsLayout
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TabsLayout
impl RefUnwindSafe for TabsLayout
impl Send for TabsLayout
impl Sync for TabsLayout
impl Unpin for TabsLayout
impl UnwindSafe for TabsLayout
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.