pub struct Rail { /* private fields */ }Expand description
Rail — a compact, always-icon-only vertical navigation strip.
Where a collapsed Sidebar is a temporary icon view of a labelled
panel, a Rail is a permanent slim bar (think a VS Code activity bar or
a Material navigation rail). Labels always live in hover tooltips. Items
added after footer are pinned to the bottom of the rail.
ⓘ
let clicked = sc::Rail::new("rail")
.selected(self.page)
.show(ui, |r| {
r.item(sc::IconKind::Home, "Home"); // 0
r.item(sc::IconKind::Search, "Explore"); // 1
r.footer(); // pin the rest to the bottom
r.item(sc::IconKind::Settings, "Settings"); // 2
});
if let Some(i) = clicked { self.page = i; }Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rail
impl RefUnwindSafe for Rail
impl Send for Rail
impl Sync for Rail
impl Unpin for Rail
impl UnsafeUnpin for Rail
impl UnwindSafe for Rail
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