gpui: Support is_resizable and is_minimizable support for window

This commit is contained in:
Floyd Wang 2025-08-22 18:43:46 +08:00
parent 11545c669e
commit 3f396a2311
9 changed files with 77 additions and 8 deletions

View file

@ -152,6 +152,36 @@ impl Render for WindowDemo {
)
.unwrap();
}))
.child(button("Unresizable", move |_, cx| {
cx.open_window(
WindowOptions {
is_resizable: false,
window_bounds: Some(window_bounds),
..Default::default()
},
|_, cx| {
cx.new(|_| SubWindow {
custom_titlebar: false,
})
},
)
.unwrap();
}))
.child(button("Unminimizable", move |_, cx| {
cx.open_window(
WindowOptions {
is_minimizable: false,
window_bounds: Some(window_bounds),
..Default::default()
},
|_, cx| {
cx.new(|_| SubWindow {
custom_titlebar: false,
})
},
)
.unwrap();
}))
.child(button("Hide Application", |window, cx| {
cx.hide();