-
Notifications
You must be signed in to change notification settings - Fork 316
Open
Description
Environment:
- OS: Linux (kernel 6.16.8, x86_64)
- gpui version: "0.2.2"
- gpui_component version: "0.3.1"
- rust version: "rustc 1.91.0 (f8297e351 2025-10-28)"
use gpui::*;
use gpui_component::{button::*, *};
pub struct HelloWorld;
impl Render for HelloWorld {
fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
div()
.v_flex()
.gap_2()
.size_full()
.items_center()
.justify_center()
.child("Hello, World")
.child(
Button::new("OK")
.primary()
.label("Let's Go!")
.on_click(|_, _, _| println!("Clicked!")),
)
}
}
fn main() {
let app = Application::new();
app.run(move |cx| {
gpui_component::init(cx);
cx.spawn(async move |cx| {
cx.open_window(WindowOptions::default(), |window, cx| {
let view = cx.new(|_| HelloWorld);
cx.new(|cx| Root::new(view.into(), window, cx))
})?;
Ok::<_, anyhow::Error>(())
})
.detach();
});
}- non-maximized state:
- maximized state:(The window has minimize, maximize, and close buttons, but they are overlapped by the system taskbar)
