Resizable sizes a box from its right and bottom edges and a grip at its corner, within its least and greatest size; the grip is a Tab stop whose arrows resize a step. Rotatable turns an svg to its angle inside a ring whose knob a drag moves, Shift snapping to 15 degrees, with the arrows turning it a notch. SelectionArea selects items with a band drawn on empty space, a press, Command or Shift to add, and a cursor the arrows walk with Space to add or drop; Escape clears and Command-A takes all. The gallery shows gpui's own drag and drop, drag preview, double press and wheel zoom, with pointers for Sortable, LongPress and PanZoom; pinch stays blocked, gpui 0.2.2 forwards no magnify event.
102 lines
1.7 KiB
Rust
102 lines
1.7 KiB
Rust
mod account;
|
|
mod agent;
|
|
mod buttons;
|
|
mod calendar;
|
|
mod canvas;
|
|
mod charts;
|
|
mod chat;
|
|
mod collab;
|
|
mod dashboard;
|
|
mod data;
|
|
mod debug;
|
|
mod devtools;
|
|
mod documents;
|
|
mod editor;
|
|
mod feedback;
|
|
mod files;
|
|
mod finance;
|
|
mod forms;
|
|
mod generative;
|
|
mod git;
|
|
mod interaction;
|
|
mod layout;
|
|
mod lists;
|
|
mod mail;
|
|
mod media;
|
|
mod menus;
|
|
mod messaging;
|
|
mod motion;
|
|
mod navigation;
|
|
mod onboarding;
|
|
mod overlays;
|
|
mod primitives;
|
|
mod project;
|
|
mod settings;
|
|
mod shell;
|
|
mod tables;
|
|
mod terminal;
|
|
mod theme;
|
|
mod typography;
|
|
|
|
use gpui::{AnyElement, App, Window};
|
|
|
|
use crate::script::Step;
|
|
|
|
pub struct Page {
|
|
pub number: u8,
|
|
pub slug: &'static str,
|
|
pub title: &'static str,
|
|
pub summary: &'static str,
|
|
pub render: fn(&mut Window, &mut App) -> AnyElement,
|
|
/// Interactions shot after the static pages.
|
|
pub script: &'static [Step],
|
|
}
|
|
|
|
pub const ALL: &[Page] = &[
|
|
primitives::PAGE,
|
|
typography::PAGE,
|
|
layout::PAGE,
|
|
shell::PAGE,
|
|
buttons::PAGE,
|
|
forms::PAGE,
|
|
navigation::PAGE,
|
|
menus::PAGE,
|
|
overlays::PAGE,
|
|
feedback::PAGE,
|
|
motion::PAGE,
|
|
data::PAGE,
|
|
lists::PAGE,
|
|
tables::PAGE,
|
|
charts::PAGE,
|
|
finance::PAGE,
|
|
editor::PAGE,
|
|
terminal::PAGE,
|
|
git::PAGE,
|
|
debug::PAGE,
|
|
documents::PAGE,
|
|
collab::PAGE,
|
|
chat::PAGE,
|
|
agent::PAGE,
|
|
generative::PAGE,
|
|
media::PAGE,
|
|
files::PAGE,
|
|
messaging::PAGE,
|
|
mail::PAGE,
|
|
calendar::PAGE,
|
|
project::PAGE,
|
|
canvas::PAGE,
|
|
devtools::PAGE,
|
|
dashboard::PAGE,
|
|
settings::PAGE,
|
|
account::PAGE,
|
|
onboarding::PAGE,
|
|
interaction::PAGE,
|
|
theme::PAGE,
|
|
];
|
|
|
|
pub use shell::{open_about, open_managed};
|
|
|
|
pub fn find(slug: &str) -> Option<usize> {
|
|
ALL.iter().position(|page| page.slug == slug)
|
|
}
|