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