The gallery's entry runs natively or, on wasm32, from a wasm_bindgen start through gpui_web, single-threaded with WebGL2 fallback. ?page, ?story and ?theme choose what shows; an unknown one fails in the page and the log. set_theme switches the mode later. Pictures load from ELY_GALLERY_ASSETS. scripts/stories.py writes examples/gallery/stories.json from the pages.
47 lines
1.1 KiB
Rust
47 lines
1.1 KiB
Rust
use gpui::{AnyElement, App, Window, div, prelude::*};
|
|
|
|
mod pages;
|
|
mod window;
|
|
|
|
use super::Page;
|
|
use crate::step::Step;
|
|
|
|
pub const PAGE: Page = Page {
|
|
number: 35,
|
|
slug: "settings",
|
|
title: "Settings",
|
|
summary: "A settings window: its sections, a search over them, and the controls each one holds.",
|
|
render,
|
|
script: SCRIPT,
|
|
};
|
|
|
|
const SCRIPT: &[Step] = &[
|
|
Step::DownAt("settings-layout", 60.0, 16.0),
|
|
Step::UpAt("settings-layout", 60.0, 16.0),
|
|
Step::Key("down"),
|
|
Step::Wait(200),
|
|
Step::Shot("keyboard"),
|
|
Step::Key("down"),
|
|
Step::Wait(200),
|
|
Step::Shot("network"),
|
|
Step::Key("down"),
|
|
Step::Wait(200),
|
|
Step::Shot("privacy"),
|
|
Step::Key("down"),
|
|
Step::Wait(200),
|
|
Step::Shot("notifications"),
|
|
Step::Key("down"),
|
|
Step::Wait(200),
|
|
Step::Shot("startup"),
|
|
Step::Key("down"),
|
|
Step::Wait(200),
|
|
Step::Shot("storage"),
|
|
Step::Key("down"),
|
|
Step::Wait(200),
|
|
Step::Shot("advanced"),
|
|
];
|
|
|
|
fn render(window: &mut Window, cx: &mut App) -> AnyElement {
|
|
div().child(window::settings(window, cx)).into_any_element()
|
|
}
|