Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Navigation

Keep page identity in application state. NavStack is push / pop / replace with can_back when depth > 1. view calls pattern::navigation_view, which places a sidebar beside content on medium and expanded widths, and stacks with a back message on compact. navigation_view still takes that width as an argument.

One resize subscription feeds it. Subscription::map must be non-capturing; convert the size in update.

#![allow(unused)]
fn main() {
fn window_width((_id, size): (iced::window::Id, iced::Size)) -> u16 {
    size.width as u16
}

fn subscription() -> iced::Subscription<u16> {
    iced::window::resize_events().map(window_width)
}
}

List/detail, tab view, preferences, about, and status page are in icedtea::pattern — they return Elements. See Patterns.