Port · Parity: dark shots judged; the status shot waits out the tooltip; comments one short line
This commit is contained in:
16 files changed
+18
-18
No files matched your search
@@ -137,7 +137,7 @@ Ely GPUI Component. A component library for GPUI, in light and dark.
|
|||||||
- Paths with `/` between folders become a tree through `lists::Folder::of`, for `FileTree` and `files::ArchiveViewer` alike.
|
- Paths with `/` between folders become a tree through `lists::Folder::of`, for `FileTree` and `files::ArchiveViewer` alike.
|
||||||
- A folder's path over its entries is `lists::path_bar`, and its first order is `lists::listed`, folders first by name: DirectoryListing and FileExplorer share both, so every view shows one path and one order.
|
- A folder's path over its entries is `lists::path_bar`, and its first order is `lists::listed`, folders first by name: DirectoryListing and FileExplorer share both, so every view shows one path and one order.
|
||||||
- A file's icon comes from `primitives::file_icon`, one map from name to icon for every chapter, under the owner's `primitives::IconTheme`, whose rules by name and extension come first; `files::FileIcon` draws it. What fits across a width comes from `layout::columns_for`, and `layout::fit` adds the inset that centers it.
|
- A file's icon comes from `primitives::file_icon`, one map from name to icon for every chapter, under the owner's `primitives::IconTheme`, whose rules by name and extension come first; `files::FileIcon` draws it. What fits across a width comes from `layout::columns_for`, and `layout::fit` adds the inset that centers it.
|
||||||
- Badges, tags and avatars live in `data_display`; forms and shell draw theirs from there, and `data_display` imports neither. A hue worn in a row, a label's or an event's, is `data_display::color_mark`, and `Palette::hue` gives the chart color by index. Avatars take square pictures. A tag is never wider than its container; a long label ends in an ellipsis beside its remove mark.
|
- Badges, tags and avatars live in `data_display`; forms and shell draw theirs from there, and `data_display` imports neither. A hue worn in a row, a label's or an event's, is `data_display::color_mark`, and `Palette::hue` gives the chart color by index. A tag is never wider than its container; a long label ends in an ellipsis beside its remove mark.
|
||||||
- A picture drawn in code reaches gpui as a `RenderImage`. A host that replaces one frees the old through `App::drop_image`, or every frame stays in the sprite atlas (the gallery's model).
|
- A picture drawn in code reaches gpui as a `RenderImage`. A host that replaces one frees the old through `App::drop_image`, or every frame stays in the sprite atlas (the gallery's model).
|
||||||
- `img()` keeps loading state, and moves an animated picture's frames, only with an id; the frames hold still while its window is inactive or gpui's own `reduce_motion` is on, which the theme's reduced motion does not set. Content masks are rectangles, but `img()` draws only the part of its picture inside its box and rounds that part with its own radius, so a `Cover` crop keeps its corners.
|
- `img()` keeps loading state, and moves an animated picture's frames, only with an id; the frames hold still while its window is inactive or gpui's own `reduce_motion` is on, which the theme's reduced motion does not set. Content masks are rectangles, but `img()` draws only the part of its picture inside its box and rounds that part with its own radius, so a `Cover` crop keeps its corners.
|
||||||
- gpui reads a `&str` picture source with a scheme as a web address, and any other as an embedded asset. A file goes through `Path` (`documents::source` in the crate, `Path::new` in the gallery).
|
- gpui reads a `&str` picture source with a scheme as a web address, and any other as an embedded asset. A file goes through `Path` (`documents::source` in the crate, `Path::new` in the gallery).
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ const SCRIPT: &[Step] = &[
|
|||||||
Step::Wait(300),
|
Step::Wait(300),
|
||||||
Step::DownAt("status", 249.0, 11.0),
|
Step::DownAt("status", 249.0, 11.0),
|
||||||
Step::UpAt("status", 249.0, 11.0),
|
Step::UpAt("status", 249.0, 11.0),
|
||||||
Step::Wait(300),
|
Step::Wait(900),
|
||||||
Step::Shot("status"),
|
Step::Shot("status"),
|
||||||
Step::Rest,
|
Step::Rest,
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ pub enum Step {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const FRAME: Duration = Duration::from_millis(120);
|
const FRAME: Duration = Duration::from_millis(120);
|
||||||
/// How long a shot waits for each frame of the window it shoots.
|
/// How long a shot waits for each frame.
|
||||||
const SHOWN: Duration = Duration::from_secs(5);
|
const SHOWN: Duration = Duration::from_secs(5);
|
||||||
/// How long an out-of-process file panel may take to open.
|
/// How long an out-of-process file panel may take to open.
|
||||||
const PANEL: Duration = Duration::from_secs(10);
|
const PANEL: Duration = Duration::from_secs(10);
|
||||||
@@ -151,7 +151,7 @@ pub async fn play(
|
|||||||
last.x + (goal.x - last.x) * t,
|
last.x + (goal.x - last.x) * t,
|
||||||
last.y + (goal.y - last.y) * t,
|
last.y + (goal.y - last.y) * t,
|
||||||
);
|
);
|
||||||
// Each move twice, as gpui 0.2.2 replayed a held drag; gpui_macos replays only under a real button.
|
// Each move twice: gpui_macos replays no posted drag.
|
||||||
for _ in 0..2 {
|
for _ in 0..2 {
|
||||||
send(window, Mouse::Drag, at, cx)?;
|
send(window, Mouse::Drag, at, cx)?;
|
||||||
cx.background_executor()
|
cx.background_executor()
|
||||||
@@ -255,7 +255,7 @@ pub async fn play(
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Waits three frames: the first draws what the steps left, and AppKit shows it by the third, since gpui presents without waiting on the GPU.
|
/// Waits three frames, until AppKit shows what the steps left.
|
||||||
pub async fn shown(window: gpui::AnyWindowHandle, cx: &mut AsyncApp) -> Result<()> {
|
pub async fn shown(window: gpui::AnyWindowHandle, cx: &mut AsyncApp) -> Result<()> {
|
||||||
for _ in 0..3 {
|
for _ in 0..3 {
|
||||||
let (drawn, frame) = futures::channel::oneshot::channel();
|
let (drawn, frame) = futures::channel::oneshot::channel();
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ impl Avatar {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A square picture: gpui clips pictures to rectangles, so a cropped one keeps square corners.
|
/// A picture, cropped to fill the avatar.
|
||||||
pub fn image(mut self, source: impl Into<ImageSource>) -> Self {
|
pub fn image(mut self, source: impl Into<ImageSource>) -> Self {
|
||||||
self.image = Some(source.into());
|
self.image = Some(source.into());
|
||||||
self
|
self
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ fn units_rest_on_the_bottom_of_a_statistics_number(cx: &mut TestAppContext) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A lone digit in extra-small text, whose line is no whole number of device pixels.
|
/// A lone digit whose line is no whole device pixel.
|
||||||
struct Nine;
|
struct Nine;
|
||||||
|
|
||||||
impl Render for Nine {
|
impl Render for Nine {
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ fn every_chart_fills_a_column_its_block_measures_by_content(cx: &mut TestAppCont
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A converter in a 460px box beside a card 260 wide, in a 280px row.
|
/// A converter squeezed beside a card in a 280px row.
|
||||||
struct Squeezed;
|
struct Squeezed;
|
||||||
|
|
||||||
impl Render for Squeezed {
|
impl Render for Squeezed {
|
||||||
|
|||||||
+1
-1
@@ -125,7 +125,7 @@ impl RenderOnce for Input {
|
|||||||
.flex_1()
|
.flex_1()
|
||||||
.min_w_0()
|
.min_w_0()
|
||||||
.child(self.state)
|
.child(self.state)
|
||||||
// An empty strut keeps the frame's inset to type in; squeezed, it spills unseen.
|
// An empty strut keeps the frame's inset to type in.
|
||||||
.child(div().px(theme.control_padding(self.size)).border_x_1()),
|
.child(div().px(theme.control_padding(self.size)).border_x_1()),
|
||||||
)
|
)
|
||||||
.when(self.clearable && !empty && !disabled, |frame| {
|
.when(self.clearable && !empty && !disabled, |frame| {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ fn angle_at(bounds: Bounds<Pixels>, at: Point<Pixels>, snap: bool) -> f32 {
|
|||||||
|
|
||||||
type OnTurn = Rc<dyn Fn(f32, &mut Window, &mut App)>;
|
type OnTurn = Rc<dyn Fn(f32, &mut Window, &mut App)>;
|
||||||
|
|
||||||
/// An svg turned to its angle, in degrees clockwise from straight up, inside a ring with a knob at that angle. A drag on the knob turns it, Shift snapping to 15°; with focus, Left and Right turn it by 15°. gpui turns svgs alone, so the picture is an svg path.
|
/// An svg turned clockwise by degrees, with a knob to drag.
|
||||||
#[derive(IntoElement)]
|
#[derive(IntoElement)]
|
||||||
pub struct Rotatable {
|
pub struct Rotatable {
|
||||||
id: ElementId,
|
id: ElementId,
|
||||||
|
|||||||
+1
-1
@@ -68,7 +68,7 @@ fn opened(cx: &mut TestAppContext, reduced: bool) -> &mut VisualTestContext {
|
|||||||
cx
|
cx
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Presses on the grab and drags it down by `dy`, past gpui's drag threshold.
|
/// Presses the grab and drags it down by `dy`.
|
||||||
fn pull(cx: &mut VisualTestContext, dy: f32) -> Point<Pixels> {
|
fn pull(cx: &mut VisualTestContext, dy: f32) -> Point<Pixels> {
|
||||||
let rest = body(cx).origin;
|
let rest = body(cx).origin;
|
||||||
let grab = point(rest.x + px(10.0), rest.y - px(28.0));
|
let grab = point(rest.x + px(10.0), rest.y - px(28.0));
|
||||||
|
|||||||
+1
-1
@@ -403,7 +403,7 @@ fn effects_keep_their_content_and_let_presses_through(cx: &mut TestAppContext) {
|
|||||||
assert_eq!(view.read_with(cx, |effects, _| effects.presses), 1);
|
assert_eq!(view.read_with(cx, |effects, _| effects.presses), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Rows rising in, in a sized box down a column that fills a row.
|
/// Rows rising in a sized box.
|
||||||
struct Rising;
|
struct Rising;
|
||||||
|
|
||||||
impl Render for Rising {
|
impl Render for Rising {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ pub(super) fn arrive<E: Styled>(element: E, entrance: Entrance, t: f32) -> E {
|
|||||||
let t = ease_out_cubic(t);
|
let t = ease_out_cubic(t);
|
||||||
match entrance {
|
match entrance {
|
||||||
Entrance::Fade => element.opacity(t),
|
Entrance::Fade => element.opacity(t),
|
||||||
// Padding, as taffy's size cache drops a margin that collapses through a block.
|
// Padding: taffy's size cache drops a collapsed margin.
|
||||||
Entrance::Rise => element.opacity(t).pt(NUDGE * 2.0 * (1.0 - t)),
|
Entrance::Rise => element.opacity(t).pt(NUDGE * 2.0 * (1.0 - t)),
|
||||||
Entrance::Slide => element.opacity(t).ml(NUDGE * -4.0 * (1.0 - t)),
|
Entrance::Slide => element.opacity(t).ml(NUDGE * -4.0 * (1.0 - t)),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ impl Palette {
|
|||||||
)
|
)
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
// Padding grows the box a scrim centers, as a margin taffy kept would.
|
// Padding grows the box the scrim centers.
|
||||||
div().child(card).with_animation(
|
div().child(card).with_animation(
|
||||||
(self.id, "in"),
|
(self.id, "in"),
|
||||||
Animation::new(motion::duration(motion::BASE, cx)).with_easing(motion::ease_out_cubic),
|
Animation::new(motion::duration(motion::BASE, cx)).with_easing(motion::ease_out_cubic),
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ impl RenderOnce for Dialog {
|
|||||||
})
|
})
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
} else {
|
} else {
|
||||||
// Padding grows the box the scrim centers, as a margin taffy kept would.
|
// Padding grows the box the scrim centers.
|
||||||
div()
|
div()
|
||||||
.child(card)
|
.child(card)
|
||||||
.with_animation((self.id.clone(), "in"), arrive, |card, t| {
|
.with_animation((self.id.clone(), "in"), arrive, |card, t| {
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ fn a_popover_opened_by_its_owner_takes_no_icon() {
|
|||||||
let _ = Popover::with_opener("own", |_| div(), |_, _, _| div()).icon(IconName::Clock);
|
let _ = Popover::with_opener("own", |_| div(), |_, _, _| div()).icon(IconName::Clock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A dialog open from the first frame, with a body the test can find.
|
/// A dialog open from the first frame.
|
||||||
struct Rising;
|
struct Rising;
|
||||||
|
|
||||||
impl Render for Rising {
|
impl Render for Rising {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ pub(crate) fn framed(ratio: f32, cx: &App) -> Div {
|
|||||||
frame
|
frame
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Themed `img()` that fills the box it is given; a `Cover` crop keeps its rounded corners.
|
/// Themed `img()` that fills the box it is given.
|
||||||
#[derive(IntoElement)]
|
#[derive(IntoElement)]
|
||||||
pub struct Image {
|
pub struct Image {
|
||||||
id: ElementId,
|
id: ElementId,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ fn nested() -> bool {
|
|||||||
LAYERS.with_borrow(|layers| !layers.is_empty())
|
LAYERS.with_borrow(|layers| !layers.is_empty())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Draws `child` over the page, as gpui's `deferred` does. gpui paints deferred draws by priority alone, so what is raised inside something raised is laid out and drawn last within it, under `id`: a list opened in a dialog lies over the dialog and keeps its state.
|
/// Draws `child` over the page; inside a raise, last within it.
|
||||||
pub fn raise(id: impl Into<ElementId>, child: impl IntoElement) -> Raised {
|
pub fn raise(id: impl Into<ElementId>, child: impl IntoElement) -> Raised {
|
||||||
let layer = Layer {
|
let layer = Layer {
|
||||||
child: child.into_any_element(),
|
child: child.into_any_element(),
|
||||||
|
|||||||
Reference in new issue
Block a user