Capture · Roots: roots drop w_full; hosts give the width
145 component roots drop w_full, the early returns included. Three field rows keep it, Input, InputGroup and TagInput: stretched without a width, taffy 0.9 laid the field's flex_1 share at no width in the template picker at 280px, and the placeholder drew nothing. Container keeps it, since mx_auto needs a width to fill. Hosts that relied on a root's width now give it: MessageList boxes each row at the list's width, the splash gives its bar the column's, and test stages that mount a component as the window's root sit in a size_full box. Tests hold a narrow row across the list and the splash bar across its column; each goes red without its fix. The gallery gains --narrow <px>, which lays each page in a padded card at that width and shoots it without its script. The page header wraps: the title takes the room and the theme switcher drops below, where a long summary used to push it past the edge. A file panel step waits for the panel to become key instead of a fixed pause, which lost a race in a capture.
This commit is contained in:
1 parent
3be809a660
commit
81e73b79c1
126 files changed
+275
-276
No files matched your search
+20
-16
@@ -1,6 +1,6 @@
|
||||
use gpui::{
|
||||
Context, Hsla, IntoElement, Modifiers, MouseButton, Render, TestAppContext, Window, point, px,
|
||||
rgb, rgba,
|
||||
Context, Hsla, IntoElement, Modifiers, MouseButton, ParentElement, Render, Styled,
|
||||
TestAppContext, Window, div, point, px, rgb, rgba,
|
||||
};
|
||||
|
||||
use super::setup;
|
||||
@@ -13,14 +13,16 @@ struct Picked {
|
||||
impl Render for Picked {
|
||||
fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||
let view = cx.entity();
|
||||
ColorPicker::new("picked", self.color)
|
||||
.opaque()
|
||||
.on_change(move |color, _, cx| {
|
||||
view.update(cx, |view, cx| {
|
||||
view.color = color;
|
||||
cx.notify();
|
||||
})
|
||||
})
|
||||
div()
|
||||
.size_full()
|
||||
.child(ColorPicker::new("picked", self.color).opaque().on_change(
|
||||
move |color, _, cx| {
|
||||
view.update(cx, |view, cx| {
|
||||
view.color = color;
|
||||
cx.notify();
|
||||
})
|
||||
},
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,12 +43,14 @@ struct Gradient {
|
||||
impl Render for Gradient {
|
||||
fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||
let view = cx.entity();
|
||||
GradientEditor::new("gradient", self.stops.clone()).on_change(move |next, _, cx| {
|
||||
view.update(cx, |view, cx| {
|
||||
view.stops = next.to_vec();
|
||||
cx.notify();
|
||||
})
|
||||
})
|
||||
div().size_full().child(
|
||||
GradientEditor::new("gradient", self.stops.clone()).on_change(move |next, _, cx| {
|
||||
view.update(cx, |view, cx| {
|
||||
view.stops = next.to_vec();
|
||||
cx.notify();
|
||||
})
|
||||
}),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,12 +48,16 @@ struct Pad {
|
||||
impl Render for Pad {
|
||||
fn render(&mut self, _: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
|
||||
let view = cx.entity();
|
||||
SignaturePad::new("pad", self.strokes.clone()).on_change(move |next, _, cx| {
|
||||
view.update(cx, |view, cx| {
|
||||
view.strokes = next.to_vec();
|
||||
cx.notify();
|
||||
})
|
||||
})
|
||||
div()
|
||||
.size_full()
|
||||
.child(
|
||||
SignaturePad::new("pad", self.strokes.clone()).on_change(move |next, _, cx| {
|
||||
view.update(cx, |view, cx| {
|
||||
view.strokes = next.to_vec();
|
||||
cx.notify();
|
||||
})
|
||||
}),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user