Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
WIP
Nathan Sobodd6425e898d8
diff --git a/crates/gpui/playground/src/playground.rs b/crates/gpui/playground/src/playground.rsindex 9a2f30c4446..699ec7eaebd 100644--- a/crates/gpui/playground/src/playground.rs+++ b/crates/gpui/playground/src/playground.rs@@ -1,6 +1,9 @@use std::ops::{Deref, DerefMut};-use gpui::{AnyElement, Element, Entity, View};+use gpui::{+ platform::{TitlebarOptions, WindowOptions},+ AnyElement, Element, Entity, View,+};use log::LevelFilter;use simplelog::SimpleLogger;@@ -9,7 +12,16 @@ fn main() {gpui::App::new(()).unwrap().run(|cx| {cx.platform().activate(true);- cx.add_window(Default::default(), |_| Playground::default());+ cx.add_window(+ WindowOptions {+ titlebar: Some(TitlebarOptions {+ appears_transparent: true,+ ..Default::default()+ }),+ ..Default::default()+ },+ |_| Playground::default(),+ );});}diff --git a/crates/gpui/playground/ui/src/frame.rs b/crates/gpui/playground/ui/src/frame.rsindex 780b8cc5f85..e6481fd861f 100644--- a/crates/gpui/playground/ui/src/frame.rs+++ b/crates/gpui/playground/ui/src/frame.rs@@ -657,6 +657,15 @@ impl Size<Rems> {}}+impl From<Length> for Size<Length> {+ fn from(value: Length) -> Self {+ Self {+ width: value,+ height: value,+ }+ }+}+#[derive(Clone, Default, Debug)]pub struct Edges<T> {top: T,diff --git a/crates/gpui/playground/ui/src/playground_ui.rs b/crates/gpui/playground/ui/src/playground_ui.rsindex 0c1fc46d515..2976d59cd73 100644--- a/crates/gpui/playground/ui/src/playground_ui.rs+++ b/crates/gpui/playground/ui/src/playground_ui.rs@@ -3,7 +3,7 @@use frame::{length::auto, *};use gpui::{AnyElement, Element, LayoutContext, View, ViewContext};use std::{borrow::Cow, cell::RefCell, marker::PhantomData, rc::Rc};-use themes::ThemeColors;+use themes::{rose_pine, ThemeColors};use tokens::{margin::m4, text::lg};mod color;@@ -18,12 +18,14 @@ impl<V: View> Frame<V> {}impl<V: View> Playground<V> {pub fn render(&mut self, _: &mut V, _: &mut gpui::ViewContext<V>) -> impl Element<V> {- column()+ workspace(&rose_pine::dawn())}}fn workspace<V: View>(theme: &ThemeColors) -> impl Element<V> {column()+ .size(auto())+ .fill(theme.base(0.1)).child(title_bar(theme)).child(stage(theme)).child(status_bar(theme))diff --git a/crates/gpui/playground/ui/src/themes.rs b/crates/gpui/playground/ui/src/themes.rsindex b823c45c8bc..f82954d94e4 100644--- a/crates/gpui/playground/ui/src/themes.rs+++ b/crates/gpui/playground/ui/src/themes.rs@@ -24,49 +24,63 @@ pub struct ThemeColors {impl ThemeColors {pub fn base(&self, level: f32) -> Hsla {- self.deleted.lerp(level)+ self.base.lerp(level)}+pub fn surface(&self, level: f32) -> Hsla {- self.deleted.lerp(level)+ self.surface.lerp(level)}+pub fn overlay(&self, level: f32) -> Hsla {- self.deleted.lerp(level)+ self.overlay.lerp(level)}+pub fn muted(&self, level: f32) -> Hsla {- self.deleted.lerp(level)+ self.muted.lerp(level)}+pub fn subtle(&self, level: f32) -> Hsla {- self.deleted.lerp(level)+ self.subtle.lerp(level)}+pub fn text(&self, level: f32) -> Hsla {- self.deleted.lerp(level)+ self.text.lerp(level)}+pub fn highlight_low(&self, level: f32) -> Hsla {- self.deleted.lerp(level)+ self.highlight_low.lerp(level)}+pub fn highlight_med(&self, level: f32) -> Hsla {- self.deleted.lerp(level)+ self.highlight_med.lerp(level)}+pub fn highlight_high(&self, level: f32) -> Hsla {- self.deleted.lerp(level)+ self.highlight_high.lerp(level)}+pub fn success(&self, level: f32) -> Hsla {- self.deleted.lerp(level)+ self.success.lerp(level)}+pub fn warning(&self, level: f32) -> Hsla {- self.deleted.lerp(level)+ self.warning.lerp(level)}+pub fn error(&self, level: f32) -> Hsla {- self.deleted.lerp(level)+ self.error.lerp(level)}+pub fn inserted(&self, level: f32) -> Hsla {- self.deleted.lerp(level)+ self.inserted.lerp(level)}+pub fn deleted(&self, level: f32) -> Hsla {self.deleted.lerp(level)}+pub fn modified(&self, level: f32) -> Hsla {- self.deleted.lerp(level)+ self.modified.lerp(level)}}diff --git a/crates/gpui/src/platform.rs b/crates/gpui/src/platform.rsindex 1d93a45fc7b..4dda941fd59 100644--- a/crates/gpui/src/platform.rs+++ b/crates/gpui/src/platform.rs@@ -180,7 +180,7 @@ pub struct WindowOptions<'a> {pub screen: Option<Rc<dyn Screen>>,}-#[derive(Debug)]+#[derive(Debug, Default)]pub struct TitlebarOptions<'a> {pub title: Option<&'a str>,pub appears_transparent: bool,