T44d Web · Gallery builds for wasm32: one story per section by URL, themed by the host
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.
This commit is contained in:
1 parent
a03df0987c
commit
48c7b09d8d
83 files changed
+1000
-455
No files matched your search
@@ -8,51 +8,10 @@ use crate::{
|
||||
capture::{number, popup_number, snapshot},
|
||||
probe::{Opened, Probes},
|
||||
shell::Gallery,
|
||||
step::Step,
|
||||
swipe::{BEGAN, CHANGED, ENDED, swipe},
|
||||
};
|
||||
|
||||
/// One scripted input, aimed at a probe by key.
|
||||
pub enum Step {
|
||||
Rest,
|
||||
Hover(&'static str),
|
||||
/// Moves the pointer to an offset from the probe's top-left corner.
|
||||
HoverAt(&'static str, f32, f32),
|
||||
Down(&'static str),
|
||||
Up(&'static str),
|
||||
Click(&'static str),
|
||||
/// Clicks just inside the probe's right edge.
|
||||
ClickEnd(&'static str),
|
||||
/// Presses at an offset from the probe's top-left corner.
|
||||
DownAt(&'static str, f32, f32),
|
||||
/// Right-clicks at an offset from the probe's top-left corner.
|
||||
RightAt(&'static str, f32, f32),
|
||||
/// Drags from the last point to an offset, in small steps.
|
||||
DragTo(&'static str, f32, f32),
|
||||
/// Swipes two fingers sideways across the probe's middle, as a trackpad does: begin, move, end.
|
||||
Swipe(&'static str, f32),
|
||||
UpAt(&'static str, f32, f32),
|
||||
Key(&'static str),
|
||||
/// Types text into whatever holds focus, one key at a time.
|
||||
Type(&'static str),
|
||||
Wait(u64),
|
||||
Shot(&'static str),
|
||||
/// Photographs a window a demo opened, by its key.
|
||||
ShotWindow(&'static str, &'static str),
|
||||
CloseWindow(&'static str),
|
||||
/// Sends a keystroke to a window a demo opened.
|
||||
KeyWindow(&'static str, &'static str),
|
||||
/// Asks AppKit to close a window, as its close button would.
|
||||
CloseNative(&'static str),
|
||||
/// Fails unless the window is gone.
|
||||
ExpectClosed(&'static str),
|
||||
/// Photographs this app's frontmost popup, such as the share picker.
|
||||
ShotPopup(&'static str),
|
||||
/// Posts a key down to AppKit itself; `escape` and `5` are known.
|
||||
NativeKey(&'static str),
|
||||
/// Cancels the open file panel, whose content runs out of process.
|
||||
CancelPanel,
|
||||
}
|
||||
|
||||
const FRAME: Duration = Duration::from_millis(120);
|
||||
/// How long a shot waits for each frame.
|
||||
const SHOWN: Duration = Duration::from_secs(5);
|
||||
|
||||
Reference in new issue
Block a user