pub struct SidebarItem<T: 'static> { /* private fields */ }Expand description
An item of a Sidebar: a title, the value choosing it gives the
sidebar’s selection, and optionally an icon, a subtitle and a context
menu.
In view!, its text is its title:
<SidebarItem value=Page::General icon="gearshape">"General"</SidebarItem>.
Implementations§
Source§impl<T: 'static> SidebarItem<T>
impl<T: 'static> SidebarItem<T>
pub fn new(title: impl IntoValue<String>, value: T) -> SidebarItem<T>
Sourcepub fn value<U: 'static>(self, value: U) -> SidebarItem<U>
pub fn value<U: 'static>(self, value: U) -> SidebarItem<U>
The value choosing it gives the sidebar’s selection.
Sourcepub fn subtitle(self, subtitle: impl IntoValue<String>) -> SidebarItem<T>
pub fn subtitle(self, subtitle: impl IntoValue<String>) -> SidebarItem<T>
A second line under the title, in the platform’s secondary style (a machine’s system and state, a mailbox’s account). The row is as tall as the two lines need.
Its context menu, which the platform shows its own way on the item
(a right-click, a long press, the menu key). Takes what
ElementBuilder::context_menu
takes, with the same reactive titles and states.
Sourcepub fn icon(self, name: impl Into<String>) -> SidebarItem<T>
pub fn icon(self, name: impl Into<String>) -> SidebarItem<T>
The name of its icon in the platform’s own set, picked with
platform!: an SF Symbol on macOS ("gearshape"), a symbolic icon
of the theme on GTK and KDE ("preferences-system-symbolic"), a
Segoe Fluent Icons glyph on Windows ("\u{E713}"). Empty: none.
A platform that can’t find it shows none.