example: Fix title bar paddings for window_title example. (#1429)

This commit is contained in:
Jason Lee 2025-10-24 21:54:52 +08:00 committed by GitHub
parent 6ebb9418a0
commit 5f63ddb822
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,7 +2,7 @@ use anyhow::anyhow;
use gpui::*; use gpui::*;
use gpui_component::{ use gpui_component::{
button::{Button, ButtonVariants}, button::{Button, ButtonVariants},
v_flex, Root, TitleBar, h_flex, v_flex, Root, TitleBar,
}; };
use rust_embed::Embed; use rust_embed::Embed;
use std::borrow::Cow; use std::borrow::Cow;
@ -37,11 +37,14 @@ impl Render for Example {
.size_full() .size_full()
.child( .child(
// Render custom title bar on top of Root view. // Render custom title bar on top of Root view.
TitleBar::new() TitleBar::new().child(
.justify_between() h_flex()
.pr_2() .w_full()
.child("App with Custom title bar") .pr_2()
.child("Right Item"), .justify_between()
.child("App with Custom title bar")
.child("Right Item"),
),
) )
.child( .child(
div() div()