From 21c74ca78dbc297b308df8a30c00ffa85e23eab6 Mon Sep 17 00:00:00 2001 From: Nate Date: Fri, 10 Sep 2021 13:42:38 -0400 Subject: [PATCH] Add "zed" label to the title bar --- zed/assets/themes/_base.toml | 1 + zed/src/theme.rs | 2 +- zed/src/workspace.rs | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/zed/assets/themes/_base.toml b/zed/assets/themes/_base.toml index dc7d91ee731c67d536104f8618f1debea9c15d8d..6c0c37fa9876961734c5d56473162edd51fc4d2c 100644 --- a/zed/assets/themes/_base.toml +++ b/zed/assets/themes/_base.toml @@ -7,6 +7,7 @@ pane_divider = { width = 1, color = "$border.0" } [workspace.titlebar] border = { width = 1, bottom = true, color = "$border.0" } +text = { extends = "$text.0" } [workspace.tab] text = "$text.2" diff --git a/zed/src/theme.rs b/zed/src/theme.rs index e8347dad8418820a8e57c43913367b415c5eb322..12496251f4c006de4db4841dd927d51cad1bef07 100644 --- a/zed/src/theme.rs +++ b/zed/src/theme.rs @@ -34,7 +34,7 @@ pub struct SyntaxTheme { #[derive(Deserialize)] pub struct Workspace { pub background: Color, - pub titlebar: ContainerStyle, + pub titlebar: ContainedLabel, pub tab: Tab, pub active_tab: Tab, pub pane_divider: Border, diff --git a/zed/src/workspace.rs b/zed/src/workspace.rs index 07cac2bc4e317048aeb8a492c887333c51af6fed..df10aef54d641b316c8fc567963ee249f1f4abd6 100644 --- a/zed/src/workspace.rs +++ b/zed/src/workspace.rs @@ -949,13 +949,22 @@ impl View for Workspace { fn render(&mut self, cx: &mut RenderContext) -> ElementBox { let settings = self.settings.borrow(); + let theme = &settings.theme; Container::new( Flex::column() .with_child( ConstrainedBox::new( - Container::new(Empty::new().boxed()) - .with_style(&settings.theme.workspace.titlebar) - .boxed(), + Container::new( + Align::new( + Label::new( + "zed".into(), + theme.workspace.titlebar.label.clone() + ).boxed() + ) + .boxed() + ) + .with_style(&theme.workspace.titlebar.container) + .boxed(), ) .with_height(32.) .named("titlebar"),