Open new windows with a default size and position (#9204)
This PR changes GPUI to open windows with a default size and location, and to otherwise inherit from their spawning window. Note: The linux build now crashes on startup. Release Notes: - N/A --------- Co-authored-by: Nathan <nathan@zed.dev> Co-authored-by: Ezekiel Warren <zaucy@users.noreply.github.com>
This commit is contained in:
parent
9a2dceeea1
commit
e792c1a5c5
30 changed files with 443 additions and 347 deletions
|
@ -23,18 +23,17 @@ impl Render for HelloWorld {
|
|||
|
||||
fn main() {
|
||||
App::new().run(|cx: &mut AppContext| {
|
||||
let options = WindowOptions {
|
||||
bounds: WindowBounds::Fixed(Bounds {
|
||||
size: size(px(600.0), px(600.0)).into(),
|
||||
origin: Default::default(),
|
||||
}),
|
||||
center: true,
|
||||
..Default::default()
|
||||
};
|
||||
cx.open_window(options, |cx| {
|
||||
cx.new_view(|_cx| HelloWorld {
|
||||
text: "World".into(),
|
||||
})
|
||||
});
|
||||
let bounds = Bounds::centered(size(px(600.0), px(600.0)), cx);
|
||||
cx.open_window(
|
||||
WindowOptions {
|
||||
bounds: Some(bounds),
|
||||
..Default::default()
|
||||
},
|
||||
|cx| {
|
||||
cx.new_view(|_cx| HelloWorld {
|
||||
text: "World".into(),
|
||||
})
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue