feat: add titlebar
This commit is contained in:
@@ -71,7 +71,7 @@ async fn main() {
|
||||
.detach();
|
||||
|
||||
// Set window size
|
||||
let bounds = Bounds::centered(None, size(px(860.0), px(650.0)), cx);
|
||||
let bounds = Bounds::centered(None, size(px(900.0), px(680.0)), cx);
|
||||
|
||||
cx.open_window(
|
||||
WindowOptions {
|
||||
@@ -80,7 +80,7 @@ async fn main() {
|
||||
titlebar: Some(TitlebarOptions {
|
||||
title: Some(SharedString::new_static(APP_NAME)),
|
||||
appears_transparent: true,
|
||||
..Default::default()
|
||||
traffic_light_position: Some(point(px(9.0), px(9.0))),
|
||||
}),
|
||||
..Default::default()
|
||||
},
|
||||
|
||||
@@ -3,6 +3,7 @@ use std::sync::Arc;
|
||||
use components::{
|
||||
dock::{DockArea, DockItem},
|
||||
theme::{ActiveTheme, Theme},
|
||||
TitleBar,
|
||||
};
|
||||
use gpui::*;
|
||||
|
||||
@@ -70,6 +71,7 @@ impl AppView {
|
||||
Axis::Vertical,
|
||||
vec![DockItem::tabs(
|
||||
vec![
|
||||
Arc::new(BlockContainer::panel::<WelcomeBlock>(cx)),
|
||||
Arc::new(BlockContainer::panel::<WelcomeBlock>(cx)),
|
||||
// TODO: add chat block
|
||||
],
|
||||
@@ -86,12 +88,17 @@ impl AppView {
|
||||
|
||||
impl Render for AppView {
|
||||
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
|
||||
let mut content = div().size_full().flex().items_center().justify_center();
|
||||
let mut content = div();
|
||||
|
||||
if cx.global::<AppState>().signer.is_none() {
|
||||
content = content.child(self.onboarding.clone())
|
||||
} else {
|
||||
content = content.child(self.dock_area.clone())
|
||||
content = content
|
||||
.size_full()
|
||||
.flex()
|
||||
.flex_col()
|
||||
.child(TitleBar::new())
|
||||
.child(self.dock_area.clone())
|
||||
}
|
||||
|
||||
div()
|
||||
|
||||
Reference in New Issue
Block a user