Files
Ely-GPUI-Components/examples/gallery/pages/mod.rs
T
ZacharyZhang-NY 931e0ed6f5 Maps · View: host tiles, pins and a popup, a picker, coordinates
maps::MapView lays the host's tile for each zoom, column and row in Web
Mercator, the nearest cut scaled past the zooms it serves, on whole
pixels. gpui packs pictures in its atlas without padding and samples
them linearly, so each tile draws with a one-pixel rim copied from its
own edge, one of its pixels larger each side and clipped, and no seam
shows. A drag, the wheel or the arrows pan; Command-wheel, + and - or
its buttons zoom about the pointer or the center; the owner keeps the
viewport. MapMarker pins take a press and Enter when the map hears
them; MapPopup opens toward the map's larger half and stays inside it,
closing by its button or Escape. LocationPicker picks the place under a
center crosshair; CoordinateDisplay writes degrees or degrees, minutes
and seconds with tabular figures and a copy button. The gallery's tiles
are Natural Earth's countries, cut z0 to z3 by scripts/tiles.py.
2026-09-27 21:22:50 -04:00

108 lines
1.8 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 i18n;
mod interaction;
mod layout;
mod lists;
mod mail;
mod maps;
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,
i18n::PAGE,
maps::PAGE,
];
pub use i18n::install as install_i18n;
pub use interaction::bind_keys;
pub use shell::{open_about, open_managed};
pub fn find(slug: &str) -> Option<usize> {
ALL.iter().position(|page| page.slug == slug)
}