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. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
486f618ecc
commit
5779daef82
126 files changed
+275
-276
No files matched your search
@@ -68,12 +68,14 @@ fn choose(window: WindowHandle<shell::Gallery>, choice: shell::Choice, cx: &mut
|
||||
struct Args {
|
||||
page: Option<usize>,
|
||||
capture: Option<PathBuf>,
|
||||
narrow: Option<f32>,
|
||||
}
|
||||
|
||||
fn parse_args() -> Result<Args> {
|
||||
let mut args = Args {
|
||||
page: None,
|
||||
capture: None,
|
||||
narrow: None,
|
||||
};
|
||||
let mut iter = std::env::args().skip(1);
|
||||
while let Some(flag) = iter.next() {
|
||||
@@ -85,6 +87,13 @@ fn parse_args() -> Result<Args> {
|
||||
args.page = Some(pages::find(&value).with_context(|| format!("no page {value}"))?)
|
||||
}
|
||||
"--capture" => args.capture = Some(PathBuf::from(value)),
|
||||
"--narrow" => {
|
||||
args.narrow = Some(
|
||||
value
|
||||
.parse()
|
||||
.with_context(|| format!("bad width {value}"))?,
|
||||
)
|
||||
}
|
||||
other => bail!("unknown flag {other}"),
|
||||
}
|
||||
}
|
||||
@@ -118,13 +127,15 @@ fn main() -> Result<()> {
|
||||
};
|
||||
let window = cx
|
||||
.open_window(options, |window, cx| {
|
||||
cx.new(|cx| shell::Gallery::new(args.page.unwrap_or(0), window, cx))
|
||||
cx.new(|cx| {
|
||||
shell::Gallery::new(args.page.unwrap_or(0), args.narrow, window, cx)
|
||||
})
|
||||
})
|
||||
.expect("gallery window failed to open");
|
||||
menu_actions(window, cx);
|
||||
cx.activate(true);
|
||||
if let Some(dir) = args.capture {
|
||||
capture::run(window, dir, args.page, cx);
|
||||
capture::run(window, dir, args.page, args.narrow.is_none(), cx);
|
||||
}
|
||||
});
|
||||
Ok(())
|
||||
|
||||
Reference in new issue
Block a user