chore: always show title bar on linux and windows

This commit is contained in:
2025-06-18 12:26:04 +07:00
parent 5f5bb33654
commit 1d77fd443e

View File

@@ -63,7 +63,7 @@ pub struct ToggleModal {
pub struct ChatSpace { pub struct ChatSpace {
dock: Entity<DockArea>, dock: Entity<DockArea>,
titlebar: bool, toolbar: bool,
#[allow(unused)] #[allow(unused)]
subscriptions: SmallVec<[Subscription; 4]>, subscriptions: SmallVec<[Subscription; 4]>,
} }
@@ -189,14 +189,14 @@ impl ChatSpace {
Self { Self {
dock, dock,
subscriptions, subscriptions,
titlebar: false, toolbar: false,
} }
}) })
} }
pub fn open_onboarding(&mut self, window: &mut Window, cx: &mut Context<Self>) { pub fn open_onboarding(&mut self, window: &mut Window, cx: &mut Context<Self>) {
// Disable the titlebar // No active user, disable user's toolbar
self.titlebar(false, cx); self.toolbar(false, cx);
let panel = Arc::new(onboarding::init(window, cx)); let panel = Arc::new(onboarding::init(window, cx));
let center = DockItem::panel(panel); let center = DockItem::panel(panel);
@@ -208,8 +208,8 @@ impl ChatSpace {
} }
pub fn open_chats(&mut self, window: &mut Window, cx: &mut Context<Self>) { pub fn open_chats(&mut self, window: &mut Window, cx: &mut Context<Self>) {
// Enable the titlebar // Enable the toolbar for logged in users
self.titlebar(true, cx); self.toolbar(true, cx);
let weak_dock = self.dock.downgrade(); let weak_dock = self.dock.downgrade();
let left = DockItem::panel(Arc::new(sidebar::init(window, cx))); let left = DockItem::panel(Arc::new(sidebar::init(window, cx)));
@@ -266,8 +266,8 @@ impl ChatSpace {
}); });
} }
fn titlebar(&mut self, status: bool, cx: &mut Context<Self>) { fn toolbar(&mut self, status: bool, cx: &mut Context<Self>) {
self.titlebar = status; self.toolbar = status;
cx.notify(); cx.notify();
} }
@@ -335,13 +335,13 @@ impl Render for ChatSpace {
.flex_col() .flex_col()
.size_full() .size_full()
// Title Bar // Title Bar
.when(self.titlebar, |this| { .child(
this.child(
TitleBar::new() TitleBar::new()
// Left side // Left side
.child(div()) .child(div())
// Right side // Right side
.child( .when(self.toolbar, |this| {
this.child(
div() div()
.flex() .flex()
.items_center() .items_center()
@@ -384,9 +384,9 @@ impl Render for ChatSpace {
this.logout(window, cx); this.logout(window, cx);
})), })),
), ),
),
) )
}) }),
)
// Dock // Dock
.child(self.dock.clone()), .child(self.dock.clone()),
) )