pub struct SidebarStyle {
pub background: Color,
pub border: Border,
pub radius: Radius,
pub shadows: Vec<BoxShadow>,
pub width: f32,
pub padding: f32,
pub gap: f32,
pub title_text: TextStyle,
}Expand description
Resolved container style and intrinsic width for a Sidebar.
The backing container forwards the top border width/color and top-left radius as uniform values, so callers should use uniform borders and radii.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::SidebarStyle;
let style = SidebarStyle::from_theme(Theme::dark());
assert_eq!(style.width, 220.0);
assert_eq!(style.gap, 4.0);Fields§
§background: ColorSidebar fill.
border: BorderSidebar border; use uniform widths and colors.
radius: RadiusSidebar radii; use a uniform value for current rendering.
shadows: Vec<BoxShadow>Container shadows painted in vector order.
width: f32Intrinsic width in logical pixels.
padding: f32Inner padding on every edge in logical pixels.
gap: f32Vertical gap between title and items, and between items.
title_text: TextStyleOptional section-title text style.
Implementations§
Source§impl SidebarStyle
impl SidebarStyle
Sourcepub fn from_theme(theme: Theme) -> Self
pub fn from_theme(theme: Theme) -> Self
Resolves sidebar colors, typography, and geometry from theme.
§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_widgets::controls::SidebarStyle;
let style = SidebarStyle::from_theme(Theme::dark());
assert!(style.shadows.is_empty());
assert_eq!(style.title_text.px_size, 12);Trait Implementations§
Source§impl Clone for SidebarStyle
impl Clone for SidebarStyle
Source§fn clone(&self) -> SidebarStyle
fn clone(&self) -> SidebarStyle
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 moreSource§impl Debug for SidebarStyle
impl Debug for SidebarStyle
Source§impl Default for SidebarStyle
impl Default for SidebarStyle
Source§impl PartialEq for SidebarStyle
impl PartialEq for SidebarStyle
impl StructuralPartialEq for SidebarStyle
Auto Trait Implementations§
impl Freeze for SidebarStyle
impl RefUnwindSafe for SidebarStyle
impl Send for SidebarStyle
impl Sync for SidebarStyle
impl Unpin for SidebarStyle
impl UnwindSafe for SidebarStyle
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.